Fan is constantly on when power supply plugged, but goes silent when only on battery

I have a HP 4510s laptop. The fan control works ok under Windows. Does not work under any tried Linux distro/version. Under Linux/Ubuntu, the fan runs at some very low speed. This is not sufficient to keep CPUs cool enough under higher load.

I tried most of the hints from the internet regarding the Linux laptop fancontrol, none worked. To list, I tried lm_sensors, pwmconfig, acpi_os= setting and numerous other things to no avail. And I've updated BIOS and there's nothing except "Fan always on on AC" and it does not do the trick.

It is possible to get the system temps using lm_sensors. Furthermore, there are fan control points at

/sys/devices/virtual/thermal/cooling_device*/cur_state (* from 0-4 are active)

I ended up taking the famous tp-fancontrol (for IBM ThinkPads) script from

http://thinkwiki.org/wiki/ACPI_fan_control_script

and botched it up as hp-fancontrol. I don't remember enough from my automation studies (it was 20 years ago) so it turned out very simple. But it seems to work so far. There are lots of left-over code still and it's ugly as ****. I installed it as /usr/bin/hp_fancontrol and added trigger to /etc/rc.local like this

# Start hp-fancontrol on multiuser
/usr/bin/hp-fancontrol -l -d

exit 0

I'd be very grateful for anything better, even if it is just the control_loop part, so please comment. Also, be gentle and read the disclaimers (ugly as... above and code itself). The QUIET seems not to work, it breaks DAEMONIZE.

#!/bin/bash

# hp-fancontrol 0.1
# Based on tp-fancontrol (http://thinkwiki.org/wiki/ACPI_fan_control_script)
# Provided under the GNU General Public License version 2 or later or
# the GNU Free Documentation License version 1.2 or later, at your option.
# See http://www.gnu.org/copyleft/gpl.html for the Warranty Disclaimer.

# This script dynamically(?) controls fan speed on some HP laptop models
# (ProBook 4510s) according to user-defined temperature thresholds.  It
# implements its own decision algorithm, overriding the any embedded
# controller.
#
# Run 'hp-fancontrol --help' for options.
#
# For optimal fan behavior during suspend and resume, invoke
# "hp-fancontrol -u" during the suspend process.
#
# WARNING: This script relies on undocumented hardware features and
# overrides nominal hardware behavior. It may thus cause arbitrary
# damage to your laptop or data. Watch your temperatures!
#
# WARNING: The list of temperature ranges used below is much more liberal
# than the rules used by the embedded controller firmware, and is
# derived mostly from anecdotal evidence, hunches and wishful thinking.
# It is also model-specific (see http://thinkwiki.org/wiki/Thermal_sensors).

# Temperature ranges, per core:
# (min temperature: when to step up from 0-th fan level,
#  max temperature: when to step up to maximum fan level)
THRESHOLDS=( #  Core
# min  max   #  ----
  43   65    #  0
  43   65    #  1
)

# LEVELS=0 - 31 (5 bits)             # Fan speed levels
ANTIPULSE=1                          # Prevent fan pulsing noise
                                     # (reduces frequency of fan RPM updates)

OFF_THRESH_DELTA=3 # when gets this much cooler than 'min' above, may turn off fan
MIN_THRESH_SHIFT=0 # increase min thresholds by this much
MAX_THRESH_SHIFT=0 # increase max thresholds by this much
MIN_WAIT=180       # minimum time (seconds) to spend in a given level before
                   # stepping down

HP_ACPI=/sys/devices/virtual/thermal/cooling_device

PID_FILE=/var/run/hp-fancontrol.pid
LOGGER=/usr/bin/logger
INTERVAL=3        # sample+refresh interval
SETTLE_TIME=6     # wait this many seconds long before applying anti-pulsing
RESETTLE_TIME=600 # briefly disable anti-pulsing at every N seconds
SUSPEND_TIME=5    # seconds to sleep when receiving SIGUSR1

SEP=','           # Separator char for display

WATCHDOG_DELAY=$(( 3 * INTERVAL ))
HAVE_WATCHDOG=false
HAVE_LEVELCMD=true

QUIET=false
DRY_RUN=false
DAEMONIZE=false
AM_DAEMON=false
KILL_DAEMON=false
SUSPEND_DAEMON=false
SYSLOG=false

usage() {
    echo "
Usage: $0 [OPTION]...

Available options:
   -s N   Shift up the min temperature thresholds by N degrees
          (positive for quieter, negative for cooler).
          Max temperature thresholds are not affected.
   -S N   Shift up the max temperature thresholds by N degrees
          (positive for quieter, negative for cooler). DANGEROUS.
   -t     Test mode
   -q     Quiet mode
   -d     Daemon mode, go into background (implies -q)
   -l     Log to syslog
   -k     Kill already-running daemon
   -u     Tell already-running daemon that the system is being suspended
   -p     Pid file location for daemon mode, default: $PID_FILE
"
    exit 1;
}

while getopts 's:S:qtdlp:kuh' OPT; do
    case "$OPT" in
        s) # shift thresholds
            MIN_THRESH_SHIFT="$OPTARG"
            ;;
        S) # shift thresholds
            MAX_THRESH_SHIFT="$OPTARG"
            ;;
        t) # test mode
            DRY_RUN=true
            ;;
        q) # quiet mode
            QUIET=true
            ;;
        d) # go into background and daemonize
            DAEMONIZE=true
            ;;
        l) # log to syslog
            SYSLOG=true
            ;;
        p) # different pidfile
            PID_FILE="$OPTARG"
            ;;
        k) # kill daemon
            KILL_DAEMON=true
            ;;
        u) # suspend daemon
            SUSPEND_DAEMON=true
            ;;
        h) # short help
            usage
            ;;
        \?) # error
            usage
            ;;
    esac
done
[ $OPTIND -gt $# ] || usage  # no non-option args

# no logger found, no syslog capabilities
$SYSLOG && [ ! -x $LOGGER ] && SYSLOG=false || :

if $DRY_RUN; then
    echo "$0: Dry run, will not change fan state."
    QUIET=false
    DAEMONIZE=false
fi

thermometer() { # output list of temperatures
    # 2 basic temperatures from CPU cores:
    CPU0=`/usr/bin/sensors | /usr/bin/awk '/Core 0/ { print $3 }' | sed -e s/[^0-9]//g`
    CPU1=`/usr/bin/sensors | /usr/bin/awk '/Core 1/ { print $3 }' | sed -e s/[^0-9]//g`
    echo -n "$CPU0 $CPU1 ";
    return 0
}

speedometer() { # output fan speed RPM
    read F0 < /sys/devices/virtual/thermal/cooling_device0/cur_state
    read F1 < /sys/devices/virtual/thermal/cooling_device1/cur_state
    read F2 < /sys/devices/virtual/thermal/cooling_device2/cur_state
    read F3 < /sys/devices/virtual/thermal/cooling_device3/cur_state
    read F4 < /sys/devices/virtual/thermal/cooling_device4/cur_state
    FAN=$(($F4+$F3*2+$F2*4+$F1*8+$F0*16))
    echo -n $FAN;
    return 0
}

setlevel() { # set fan speed level
    local LEVEL=$1
    if ! $DRY_RUN; then
        if $HAVE_LEVELCMD; then
        BLEVEL=$(echo "obase=2;$LEVEL" | bc)
        LEN=$(echo ${#BLEVEL})
        BLEVEL5=`echo "0000"$BLEVEL`
        B5=${BLEVEL5:(-5)}
        echo ${B5:0:1} > /sys/devices/virtual/thermal/cooling_device0/cur_state
        echo ${B5:1:1} > /sys/devices/virtual/thermal/cooling_device1/cur_state
        echo ${B5:2:1} > /sys/devices/virtual/thermal/cooling_device2/cur_state
        echo ${B5:3:1} > /sys/devices/virtual/thermal/cooling_device3/cur_state
        echo ${B5:4:1} > /sys/devices/virtual/thermal/cooling_device4/cur_state
    else
        case "$LEVEL" in
        (auto)        LEVEL=0x80 ;;
        (disengaged)  LEVEL=0x40 ;;
        esac
            #echo 0x2F $LEVEL > $IBM_ACPI/ecdump
    fi
    fi
}

getlevel() { # get fan speed level
    # perl -e 'm/^EC 0x20: .* .(..)$/ and print $1 and exit 0 while <>; exit 1' < $IBM_ACPI/ecdump
    read F0 < /sys/devices/virtual/thermal/cooling_device0/cur_state
    read F1 < /sys/devices/virtual/thermal/cooling_device1/cur_state
    read F2 < /sys/devices/virtual/thermal/cooling_device2/cur_state
    read F3 < /sys/devices/virtual/thermal/cooling_device3/cur_state
    read F4 < /sys/devices/virtual/thermal/cooling_device4/cur_state
    FAN=$(($F4+$F3*2+$F2*4+$F1*8+$F0*16))
    echo -n $FAN;
}

log() {
    # $QUIET || echo "> $*"
    ! $SYSLOG || $LOGGER -t "`basename $0`[$$]" "$*"
}

cleanup() { # clean up after work
    $AM_DAEMON && rm -f "$PID_FILE" 2> /dev/null
    log "Shutting down, fan turned up"
    if ! $DRY_RUN; then
        if $HAVE_LEVELCMD; then
            setlevel 31
        fi
    fi
}

floor_div() {
    echo $(( (($1)+1000*($2))/($2) - 1000 ))
}

set_priority() {
    ! $DRY_RUN && renice -10 -p $$
}

init_state() {
    IDX=0
    NEW_IDX=0
    START_TIME=0
    MAX_IDX=31
    SETTLE_LEFT=0
    RESETTLE_LEFT=0
    FIRST=true
    RESTART=false
}

control_fan() {
    # Enable the fan in default mode if anything goes wrong:
    set -e -E -u
    trap "cleanup; exit 2" HUP INT ABRT QUIT SEGV TERM
    trap "cleanup" EXIT
    trap "log 'Got SIGUSR1'; setlevel 0; RESTART=true; sleep $SUSPEND_TIME" USR1

    init_state
    log "Starting dynamic fan control"

    # Control loop:
    while true; do
        # Get readouts
        TEMPS=`thermometer`
        $QUIET || SPEED=`speedometer`
        $QUIET || ECLEVEL=`getlevel`
        NOW=`date +%s`
        if echo "$TEMPS" | grep -q "[^ 0-9$SEP\n-]"; then
            echo "Invalid character in temperatures: $TEMPS" >&2; exit 1;
        fi

    OLDLEVEL=$ECLEVEL
    NEWLEVEL=$OLDLEVEL
    CHANGE=0

    for TEMP in $TEMPS; do
        if [ $TEMP -gt 430 ] ; then
        if [ $OLDLEVEL -lt 31 ] ; then
            CHANGE=$(($CHANGE+1)) ;
            # NEWLEVEL=$(($OLDLEVEL+1)) ;
        fi
        elif [ $TEMP -gt 410 ] ; then
                # No change between 41-43C
        CHANGE=$(($CHANGE)) ;
        else
        if [ $OLDLEVEL -gt 0 ] ; then
            CHANGE=$(($CHANGE-1)) ;
            # NEWLEVEL=$(($OLDLEVEL-1)) ;
        fi
        fi
        NEWLEVEL=$(($OLDLEVEL+$CHANGE)) ;
        if [ $NEWLEVEL -gt 31 ] ; then
        NEWLEVEL=31 ;
        fi
        if [ $NEWLEVEL -lt 0 ] ; then
                NEWLEVEL=0 ;
            fi
            OLDLEVEL=$NEWLEVEL ;
        done

        # Interrupted by a signal?
        if $RESTART; then
            init_state
            log "Resetting state"
            continue
        fi

        # Transition
        if [ "$ECLEVEL" != "$NEWLEVEL" ]; then
            START_TIME=$NOW
            log "Changing fan level: $ECLEVEL->$NEWLEVEL  (temps: $TEMPS)"
        fi

        setlevel $NEWLEVEL

        sleep $INTERVAL

        IDX=$NEW_IDX
        FIRST=false
    done
}

if $KILL_DAEMON || $SUSPEND_DAEMON; then
    if [ -f "$PID_FILE" ]; then
    set -e
    DPID="`cat \"$PID_FILE\"`"
    if $KILL_DAEMON; then
            kill "$DPID"
        rm "$PID_FILE"
        $QUIET || echo "Killed process $DPID"
    else # SUSPEND_DAEMON
        kill -USR1 "$DPID"
        $QUIET || echo "Sent SIGUSR1 to $DPID"
    fi
    else
        $QUIET || echo "Daemon not running."
        exit 1
    fi
elif $DAEMONIZE ; then
    if [ -e "$PID_FILE" ]; then
        echo "$0: File $PID_FILE already exists, refusing to run."
        exit 1
    else
        set_priority
        AM_DAEMON=true QUIET=false control_fan 0<&- 1>&- 2>&- &
    echo "$0: Starting as daemon"
        echo $! > "$PID_FILE"
        exit 0
    fi
else
    [ -e "$PID_FILE" ] && echo "WARNING: daemon already running"
    set_priority
    control_fan
fi


Sometimes this helped for me to get the modules build:

sudo apt install zfs-dkms
sudo modprobe zfs

sudo zfs list

This requires the build essentials and headers for the current kernel to be available. Be aware of some issues with custom build kernels.

It worked multiple times on my x64 laptops and sometimes also on a raspberry Pi which is an arm platform.

Additionally you may need to get the module to initramfs, but that is another topic.


Why are /bin and /sbin now symlinks in Ubuntu 20.04?

I hadn't noticed this change, so I dug into it a little bit.  I'm guessing it was not in the release notes because it was really an upstream change in Debian:

UsrMerge at Debian wiki

This Ubuntu announcement is the only official notification of the change I've seen

Merged-usr is now the default in Disco for new installations only

Some other general info

https://lwn.net/Articles/670071/ (Preparing for a merged /usr in Debian)
https://www.linux-magazine.com/Online/Features/Debian-usr-Merge
https://www.freedesktop.org/wiki/Software/systemd/TheCaseForTheUsrMerge/
https://lwn.net/Articles/483921/ (Various notes on /usr unification)


What is the orca package and can it be removed?

Here's the output of apt purge -s orca

dkb@dkb:~$ apt purge -s orca
NOTE: This is only a simulation!
      apt needs root privileges for real execution.
      Keep also in mind that locking is deactivated,
      so don't depend on the relevance to the real current situation!
Reading package lists... Done
Building dependency tree
Reading state information... Done
The following packages will be REMOVED:
  orca*
0 upgraded, 0 newly installed, 1 to remove and 0 not upgraded.
Purg orca [3.28.0-3ubuntu1]
dkb@dkb:~$

So it doesn't look like purging it will be a problem.

In addition, orca doesn't seem to be running on my system:

dkb@dkb:~$ ps -aux | grep orca
dkb       1999  0.0  0.0  21536  1044 pts/0    S+   16:09   0:00 grep --color=auto orca
dkb@dkb:~$

I don't know why you're having it running and so have a need to kill it.


Why does my QQuick application crash on Ubuntu?

The problem was that the signature of QGuiApplication's constructor is actually QGuiApplication(int & argc, char ** argv).
Notice that reference & with argc ! :)
I had passed argc by value so the app crashed when argc variable went out of scope.


How to retrieve data from a corrupted volume

Try ddrescue to make an image of your failing drive/partition. Then use foremost on the image you made to try and save files.

As you say you're a layman, that would mean running, these commands:

ddrescue -i0 -s50M /dev/sda6 image.dd logfile
ddrescue /dev/sda6 image.dd logfile
ddrescue -d -r3 /dev/sda6 hdimage.dd logfile

Good information on how to use ddrescue on its documentation page.

After that, try foremost on the image:

foremost -i image.dd -t all -o savedfiles -v


How can I use Gnome shell's menus in Unity?

I'm sorry but it is not possible. Unity uses GTK to draw the dropdown menus, and GNOME Shell uses CSS.


How to stop nautilus managing desktop in unity

To configure this, you'll first need to head over to Software Centre and install Gnome Tweak Tool. After you have installed it, you can find the app as Advanced Settings in the dash.

Gnome Tweak Tool lets you change various settings that affect look and feel. The one you want is “Have file manager handle the desktop” in the Desktop section. See the screenshot below.

Note that this setting is stored with gsettings, so you can also access it using a tool called dconf-editor or with this command:

gsettings set org.gnome.desktop.background show-desktop-icons false

In later versions of Ubuntu (15.04 and possibly earlier?) this setting is renamed to 'Icons on Desktop':


Pass arguments from file line by line to function

Assuming your list of files is one filename per line, the xargs utility should be able to handle filenames with spaces in them if you specify newline as the delimiting character e.g.

xargs -d '\n' file < filelist.txt

If you prefer to use a shell function

while IFS= read -r f; do [[ -z "$f" ]] || file "$f"; done < filelist.txt


Can’t get server to set up network with netplan

Netplan configuration files use YAML.  YAML is extremely indent-sensitive, and if anything is not indented properly, or not where it needs to be in order for the YAML to be parsed by netplan, you will get errors like this.

You have mismatched indents and a few things that are not in the proper location (per https://netplan.io/examples and the Netplan examples for DHCP addressing).

Try using this instead:

network:
  version: 2
  renderer: networkd
  ethernets:
    eno1:
      addresses: []
      dhcp4: true
      optional: true


Is there a shortcut key for accessing the menu bar?

Do you mean Ubuntu menu? It is Alt + F1.

For window menu, use Alt + Space. For e.g. File menu, just hold down Alt and see what letter is underlined. Example: Alt + F

Read more on: https://help.ubuntu.com/community/KeyboardShortcuts


How can I change my Mac address permanently!?

Open a terminal and:

sudo ifconfig eth0 down
sudo ifconfig eth0 hw ether 00:00:00:00:00:00
sudo ifconfig eth0 up

Where eth0 is your network interface and 00:00:00:00:00:00 is your desire MAC addres.

If you want to save this changes when rebooting you have to add this to /etc/network/interfaces

iface eth0 inet dhcp
 hwaddress ether 08:00:00:00:00:00

Source: How to change the MAC address of an Ethernet interface


How to upgrade flash player on usb-live Ubuntu?

You either need a persistent install or Full install.
Usb-creator and UNetbootin will make persistent installs.
A full install requires an 8GB drive, (you could put it on the USB HDD).

With either method you can then use Synaptic to upgrade your player.

You could also make persistent partitions on the external USB HDD.


You need to remove the libx265-32 and then install the libx265-36.

The libx265-36 has conflicts&replaces for the libx265-34.

:~$ apt-cache show libx265-36
Package: libx265-36
Source: x265
Priority: extra
Section: libs
...
Replaces: libx265-34
Conflicts: libx265-34
...
Filename: pool/main/x/x265/libx265-36_1.4~20141102~trusty~ppa1_amd64.deb

That means if you are upgrading from the libx265-34 to the libx265-36 then the upgrade will go without hickups.

At here:

Log of sudo apt-get dist-upgrade
Sun Nov  2 23:02:43 2014

...
The following packages will be REMOVED:
  libx265-34
The following NEW packages will be installed:
  libx265-36
...

----EDIT----

There is a new version 1.4~20141102~trusty~ppa2. It has replaces&conflicts the libx265-30, libx265-31, libx265-32, libx265-33, libx265-34.


Why are the fglrx drivers not up to date?

I think you may be misreading the text on the AMD website - the latest official driver there is dated 5/22/14.

The support for UbuntU 14.04 appears in the Beta driver (released 5/26/14).  I did try this driver, and it failed for me, but that is beside the point:  it is a beta driver and should probably not be included in the repos until the remaining bugs are worked out.


How to do GIF animations for instructions and learning purposes over GUI?

Please, see the threads below.

Unix Stackexchange

Creating a GIF animation from PNG files
Convert OGV video to GIF animaton
Are there any animation programs for animating static images

Ubuntu Stackexchange

How to create animated GIF images of a screencast?
How to record my screen?


Will ModemManager v1.6 be a part of Ubuntu 16.04 LTS?

Just use this PPA, which provides MM 1.6.x for Ubuntu 16.04 LTS:
https://launchpad.net/~aleksander-m/+archive/ubuntu/modemmanager-xenial


What are all the places(folders) that the Ubuntu system uses to store Application data?

Install ubuntu Tweak
sudo -E add-apt-repository ppa:tualatrix/ppa
sudo apt-get update
sudo apt-get install ubuntu-tweak

After installing open Ubuntu tweak from dash:

Select "Janitor" tabs and select "Apps" and select what you want to delete/remove and press "Clean" button(bottom right corner).


Is there any simple way to install tarballs?

Those processes are automated.  You get them in .deb or .rpm packages mostly.  The only difference (at the level you're thinking) between a tarball and a .deb is the compilation.  Tarball's generally contain source code and make files, not pre-compiled binaries (though they DO sometimes contain those too).  .debs are pre-compiled across multiple architectures.

Here's an analogy for you:

a .deb is a truck carrying a whole car.

A tarball is a truck carrying a box of car parts and a manual telling you how to assemble the parts to get the car.

So, when you install something from a .deb (or a .rpm on those "other" distros) you're installing the same stuff that you'll get in that tarball, just with the work already done for you.

Though I disagree with txwikinger about progression/regression.  There's nothing wrong at all with tarballs and I use them frequently to wrap up code or screenshots, log files, or what have you to send to people for various reasons.  I also download source tarballs to read the source code for a program so I can see what's going on if I run into a problem.


Having problem with installing JDK 7 and 8

I too am getting this error, I tried going to the edelivery.oracle.com site to see if there was an issue there and it looks like there is:

  From https://edelivery.oracle.com/download/index.html

  You are experiencing a connectivity issue with the Oracle Software Delivery Cloud. Please   try to access this site again later. If you have questions, please contact Software Delivery Customer Service at edelivery_ww@oracle.com.

Although I can not find any actual status messages, it's been like this since I started trying an hour or so ago.

Edit: It would appear to be back online now (2014-07-26 10:00 UTC).


What directories do I need to save to backup my user settings?

It'd be a good idea to just copy all of /home as that contains your documents and preferences. If you just want to know where preferences are stored, it varies. Many applications store them in .config (that's /home/username/.config) and .local. Most user preferences will be in .gconf. Some older applications might save settings in .gnome2. Firefox uses .mozilla; other browsers use .config as far as I know. To be safe, I'd just recommend backing up /home still.
Run dpkg --get-selections > ~/my-packages.txt to build up a list of everything installed (or removed) on your system. It will be saved in your home folder as my-packages.txt. Once you reinstall, run sudo dpkg --set-selections < ~/my-packages.txt (assuming the file is placed in the same location again) and then sudo apt-get -u dselect-upgrade to start installing packages. You'll want to also back up /etc/apt/ and restore it on the new installation to ensure that any extra software you may have installed is still able to be installed again.

It sounds complicated (and boy does this post look weird with this formatting) but it's not too awful considering the alternative of installing everything by hand again.


GDebi Package Installer not launching, and won't install .deb files on the ~/Desktop 18.10

Go figure... reinstalling gdebi and gdebi-core fixed the launch problem. But the original problem remains.

Update #1:

So, now I recall... I previously had a problem where if gdebi is set as the default app for .deb files, when double-clicking on a .deb file, gdebi would open, and when I clicked on the Install Package button, where it should have asked for my user password, it just quit instead.

However, if I started gdebi first, and opened the .deb file manually, then clicked Install Package, it would properly ask for my user password, and would install the .deb file as expected.

My previous fix was to modify the .desktop file's Exec= line from:

Exec=gdebi-gtk %f

to

Exec=sudo -H gdebi-gtk %f

The reinstall undid that fix, cured the launch problem, but the user password and quit problem is back.

Update #2:

I reinstalled policykit-1 and python3-apt at the suggestion of @NOrbert. No joy.

Update #3:

Oh oh oh... fresh clue! The problem with gdebi-gtk occurs when trying to install a .deb file on my Desktop. However, if I move that same .deb into a fresh new folder on my Desktop, or into my Downloads folder, gdebi-gtk works fine!

@NOrbert has confirmed the problem.


Image Viewer with multiple selections on 18.04.1 LTS

View files one by one in one single window

If you start Eye of Gnome, eog, and click on the icon with three horizontal lines, you can select Open... , get a window with files and directories, and then mark a few files. Click on Open and the files you selected will be the only files that you can view in the eog window.

View several files side by side in one single window

You can install feh

sudo apt install feh

and use it to make a montage, which means that you can view several files in the same window.

Examples

feh --limit-height 700 --limit-width 1300 --montage --thumb-height 300 --thumb-width 600 file1.png file2.png file3.png file4.png

feh --fullscreen --montage --thumb-height 600 --thumb-width 800 Pictures/

In the fullscreen example you can zoom with the up/down arrows and then 'pull' the picture-montage with the mouse (grab with the left button and move) to scroll the zoomed pictures. Notice that the resolution depends on the thumb-height and thumb-width.


How to install Ionic framework in Ubuntu 18.04 properly with all its dependencies?

In a terminal you can do the following :

curl -sL https://deb.nodesource.com/setup_12.x | sudo -E bash -
sudo apt install -y gcc g++ make nodejs
curl -sL https://dl.yarnpkg.com/debian/pubkey.gpg | sudo apt-key add -
echo "deb https://dl.yarnpkg.com/debian/ stable main" | sudo tee /etc/apt/sources.list.d/yarn.list
sudo apt update
sudo apt install -y yarn
sudo yarn global add ionic cordova

from there you should be operational :

ionic start myApp tabs

(installing with yarn as opposed to npm is optional but overall you're better off with yarn, here's a yarn cheat sheet : https://shift.infinite.red/npm-vs-yarn-cheat-sheet-8755b092e5cc)

(make sure to first remove everything you already installed with

sudo apt purge nodejs -y && sudo apt autoremove -y && sudo apt autoclean

and whatever other packages you find appropriate)


Preseed - Skip prompt for apps installed via "d-i pkgsel/include string"

Ok, it can be done with

d-i pkgsel/include string ocsinventory-agent
ocsinventory-agent ocsinventory-agent/method select http
ocsinventory-agent ocsinventory-agent/server string https://<server>/ocsinventory


Firefox downloads the video instead of playing it

After trying a number of things, finally installing Ubuntu Restricted Extras package and restarted Firefox fixed the issue.

See here about how to install the package.

Hope this helps others who are like me just starting to use Firefox on Ubuntu.


How to install 12.10 on a VirtualBox under Windows 7 Host?

Too bad not at home right now to confirm this, but i have the SAME setup as you do and as far as i remember there is an issue if you use Controller Type ICH6... not sure if this will fix the problem but you can try changing the controller to PIIX4.


How to install Xtreme Download Manager (XDM) in ubuntu 18.04?

Noobslab PPA does not have XDMan release for Cosmic Cuttlefish - the last update was of Xenial Xerus. As far as I know, XDMan does not have any reliable PPA at the moment.

Install using Tarball

Download XDMan from here
OpenJDK should have been installed already. Check on Terminal: java --version. If you get Command 'java' not found install it with:

sudo apt-get update
sudo apt-get install openjdk-11-jre

and hit Enter if asked.
For 64-bit Linux choose xdm-2018-x64.tar.xz and for 32-bit, xdm-2018-x86.tar.xz
After finishing download open Terminal and cd to the download directory; for example: cd ~/Downloads/Programs
Run tar -xvf xdm-2018-x64.tar.xz or tar -xvf xdm-2018-x86.tar.xz (according to the one you chose to download).

NOTE: You may not want to extract the file using FileRoller or other software, as it may not extract it appropriately.
Run cd xdm-2018-x64 or cd xdm-2018-x86 (again, accordingly).
Run sudo ./install.sh

Xtreme Download Manager is now installed on your system.


Terminal Warning: "Gti-Message: Failed to load module "atk-bridge"

Ubuntu 18.10 includes a package that was not currently installed on the system. Installing the package libatk-adaptor eliminates the warnings. There may be a small error in packaging for programs that implement or rely on GTK.


ubuntu 14.04 network adapter Atheros Killer E2400

I used this

modprobe alx

echo 1969 e0a1 > /sys/bus/pci/drivers/alx/new_id

from another thread with the same issue

here --> Is there any way to install Atheros e2400 drivers?

For future questions please check the askubuntu site for similar questions (preferably ones labeled [solved]) before you ask a question.


dpkg was interrupted, asked to disable UEFI Secure Boot

I had problems related to UEFI Secure Boot when installing Ubuntu 16.10.
Try confirm this with pressing Tab -> Enter (the OK button). If the problem remains you may try to disable UEFI Secure Boot on your firmware settings if this gives you such possibility.

Also, when file /var/lib/dpkg/lock exists, make sure there is no active process like apt, apt-get nor dpkg. If you cannot find such process (use ps command with root permissions), try to remove lock file.


How to start service in a chroot independently of the host system?

Looks like /sys was the problem. It worked with only /dev and /proc mounted.


Install the drivers by running in terminal or console

sudo apt-get install nvidia-346 nvidia-prime

To get to console you can press Ctrl+Alt+F1, login there and run this command, then

sudo reboot


Ubuntu 12.04 is a bit old to install PulseAudio 5, even 14.04 will ship PulseAudio 4, see the dedicated package page.

If you really need the latest version, I would rely on the PulseAudio testing ppa, which provides a properly packaged version of PulseAudio 5 for 14.04:

sudo add-apt-repository ppa:ubuntu-audio-dev/pulse-testing
sudo apt-get update
sudo apt-get install pulseaudio


Bumblebee and Lenovo IdeaPad Z580 with Nvidia GeForce GT 630M

Install the latest stable NVIDIA drivers supporting GT 630 from the Proprietary GPU drivers PPA.

Before you install new drivers uninstall every NVIDIA related software you have installed before.
This includes removing the bumblebee packages as well - they will be replaced with nvidia-prime.

Open a terminal and execute :

sudo apt-get purge nvidia* bumblebee primus
sudo reboot

Then install the latest current stable NVIDIA drivers from the long-lived branch by executing :

sudo add-apt-repository ppa:graphics-drivers/ppa
sudo apt-get update
sudo apt-get install nvidia-352 nvidia-prime
sudo reboot

To switch between intel and nvidia graphics - open NVIDIA X Server Settings -> Prime Profiles.

Note :

If you are using Ubuntu 15.10 there is no need to add the Proprietary GPU drivers repository (sudo add-apt-repository ppa:graphics-drivers/ppa) - the drivers are already included in the Ubuntu repositories. In case you can adjust it in BIOS select the switchable graphics mode.


Is there anything I should know before changing out my ram sticks? Ubuntu 13.04

Nothing is permanently installed on RAM. RAM only stores data while it has power. Changing or upgrading your RAM will not affect your linux installation


How do I give only the owner of a folder write/delete access?

Create a folder and run chmod (change file mode) to change the permissions.

mkdir folder
chmod 755 folder

actually this is the default.

Changing permissions of the content of an already existing folder:

# Give write access to owner
chmod -R u+w folder
# Revoke write access of group and others
chmod -R go-w folder
# Give read access to everyone
chmod -R a+r folder

Or together in one command (thx @chrylis)

chmod -R u=rwx,g=rx,o=rx folder


Retrieve the first few lines from testing result with head -n

Likely the DEBUG- outputs are going to the standard error stream rather than the standard output stream - try

python twoSum.py 2>&1 | head -n 1

to redirect stderr (file descriptor #2) to stdout (file descriptor #1); or (bash shorthand)

python twoSum.py |& head -n 1

For further information see the related question Using grep with pipe and ampersand to filter errors from find.


I use OpenShot.  OpenShot is an open-source program that creates, modifies, and edits video files. This is the most stable and easy to use program on Linux.

To install, just press Ctrl+Alt+T on your keyboard to open Terminal. When it opens, run the command(s) below:

sudo add-apt-repository ppa:openshot.developers/ppa
sudo apt-get update
sudo apt-get install openshot openshot-doc


Trying to get opengl 2 shaders to work glxinfo says I have 4.20 installed

Figured out what was wrong. AMD Drivers are junk, removing it & replacing w/ open source xserver-xorg-video-ati & xserver-xorg-video-radeon fixed the problem.


App for advance Sound editing (Alternative to Cool Edit Pro)

Audacity

  You can use Audacity to:

  Record live audio.
  Convert tapes and records into digital recordings or CDs.
  Edit Ogg Vorbis, MP3, WAV or AIFF sound files.
  Cut, copy, splice or mix sounds together.
  Change the speed or pitch of a recording.
  And more! See the complete list of features

Install

sudo apt-get install audacity

Tutorial


The Logitech webcam C270 seems to work pretty well with Ubuntu actually, since quite some time.

One possible problem could be that there are some issues with connecting it to a USB3 port.
But that can easlily be worked around by using a USB2 port.

If it's not that - what makes you think it does not work well?

See also https://help.ubuntu.com/community/Webcam


Lubuntu second monitor problem, windows not showing

looks like the problem was from open source NVIDIA drivers , installed proprietary drivers and everything is working as desired now.


Ubuntu command line to change input source on a display monitor?

The command you are looking for is ddccontrol, available from the regular Ubuntu repository.

WARNING! ddccontrol sends data over the i2c bus, which is inherently a dangerous thing to do. Most i2c devices are very low-level and very dumb, one misplaced command can be enough to brick them or at least freeze the computer. That said, DDC/CI is a somewhat standardized, quite established and quite old technology, so the risks is not too high.

For this reason, by default, i2c devices are only accessible to root. You will most likely need to prefix all commands below with sudo. (I have voluntarily not done it to ensure you read the instructions and not blindly copy/paste them.)

Probing your monitor

The first thing to do is to probe the various i2c buses in your computer (mine has 11 such buses...), searching for the one that is actually on the graphics card, connected to the screen.

The ddccontrol -p command does that, and shows what it found. Sample output from my computer:

Detected monitors :
 - Device: dev:/dev/i2c-4
   DDC/CI supported: Yes
   Monitor Name: VESA standard monitor
   Input type: Digital
  (Automatically selected)
Reading EDID and initializing DDC/CI at bus dev:/dev/i2c-4...
I/O warning : failed to load external entity "/usr/share/ddccontrol-db/monitor/DELD070.xml"
Document not parsed successfully.

EDID readings:
        Plug and Play ID: DELD070 [VESA standard monitor]
        Input type: Digital

Note the I/O warning: it merely means that your monitor is unknown to ddccontrol, so it does not know the description of all the non-standard commands and values it may support. This does not prevent you from issuing the commands, but this may be a trials and errors process.

Note also the detected bus name: dev:/dev/i2c-4 in my example.

Listing all commands

The ddccontrol -d dev:/dev/i2c-4 command reads all the possible controls (from 0x00 to 0xff) and shows the values it found. Of course, you should use the bus found when probing.

ddccontrol also shows a description for the controls and values that are known to it; either standard ones, or ones described in XML files. In my example, there is no XML file for my monitor (see the I/O warning above).

Querying a value

The ddccontrol -r 0x10 dev:/dev/i2c-4 queries the current value of the 0x10 control. Example output:

Reading 0x10...
Control 0x10: +/21/100 C [Brightness]

The current value is the number in the middle, 21 in my example. The value after that is supposed to be the maximum, but this seem to only work for ranged values (such as brightness and contrast), not so much for list items.

Setting a value

The ddccontrol -r 0x10 -w 25 dev:/dev/i2c-4 sets the value of the 0x10 control. Example output:

Writing 0x10, 0x19(25)...
Control 0x10: +/25/100 C [Brightness]

Note that you can set values in hexadecimal or decimal formats. In my example, I used decimal.

Changing monitor input source

I found the command and values to use to switch my monitor inputs. It works well, by you will of course need to experiment to find the values for your monitor. Mine is a Dell UltraSharp U2515H.

Control 0x60 [Input Source Select]

Value 15: DP
Value 16: mDP
Value 17: HDMI (MHL) 1
Value 18: HDMI (MHL) 2

The values are in the same order as the Input Source menu in the monitor.

For example, switching to DP: ddccontrol -r 0x60 -w 15 dev:/dev/i2c-4


How to get the number of concurrent connections of HTTP in ubuntu server

You should look at netflow options for the most detailed connections.

Netflow can be collected locally using argus, and parsed using command line curses tools, or used later in lib bindings.

A opensource GPLv2 netflow tool such as argus, provides a 'Real Time Flow Monitor' that is designed to perform comprehensive data network traffic auditing.

An example selection you can perform with argus is listed below:

To see the TopN 25 talkers, based on byte count, on a link between 2pm and 2:15 pm, getting Argus data from the file .

ramon -TopN -N 25 -t 2-2:15 -r


Can't install linux headers for ubuntu 17.10

Error: Could not find linux-headers- ubuntu 18.04 virtual machine

I issued these commands after reading many approach to this error after : sudo apt-get install linux-headers-server

uname -r
sudo apt-get list | grep headers
sudo apt-get install linux-headers-generic

The command gave me generic that was installed, the uname and the right linux-headers was installed. Gurls it works!


How can I send current line in gedit to terminal?

sudo apt-get install gedit-plugins

This adds more plugins, one of which is an embedded terminal -- Once you've installed, open gedit, go to preferences, and check it in the "plugins" tab.

You can't specifically pipe commands or blocks through, but you can save the file and easily ./test.sh, and it can be helpful for running commands through it as opposed to having another terminal open.

http://www.linuxnov.com/how-to-install-additional-plugins-for-gedit-text-editor/

Hope this helps!


Synaptics touchpad detected as PS/2 Generic Mouse on Ubuntu 13.10

I have the same problem for eight months! For me the only solution was to run the command line:

$ sudo modprobe -r psmouse; sudo modprobe psmouse

et voilá, the system recognize the touchpad again. To have a permanently solution, you can write the command above in /etc/rc.local (but without sudo).

Hope it works to you as do for me!


Some general compiling tips about missing header files:

Compiler cannot find header file, do I add the directory to PATH?

  Adding the appropriate directory to your include path is exactly what
  you're supposed to do in this case, only you're supposed to do it by
  pkg-config. Accessing the files directly using full pathnames is
  unsupported.

  Add something like this to your Makefile:

CFLAGS += `pkg-config --cflags gtk+-3.0`
 LIBS += `pkg-config --libs gtk+-3.0`

  This will automatically add the correct compiler and linker options
  for the current system.

From mail archive there are some tips that might be useful:

  Re: [Vala] Package `Gee-0.8' not found

  Ralf Ganswindt Fri, 26 Jan 2018 22:08:52 -0800

  Thank you, that was the missing info. I figured out the proper name
  for the ubuntu repository to get the -dev package and voila the .gir
  file appeared where it should. I looked through the vala directories
  and found it under /usr/share/vala/vapi/, but valac still couldn't
  find it until I copied the file to /usr/share/vala-0.36/vapi/. I don't
  know if this is unique to Ubuntu, but I figure this might be useful to
  someone.

Thanks again,

Ralf

Ralf Ganswindt
ralfganswi...@gmail.com

On Thu, Jan 25, 2018 at 12:03 PM, Al Thomas  wrote:

>

    On Thursday, 25 January 2018, 16:41:31 GMT, Ralf Ganswindt <
    ralfganswi...@gmail.com> wrote:

    I'm experimenting with Vala and so far I like how it works. However, I
    tried to compile a basic gee example from the sample programs and I get
    the
    following:

    $ valac --pkg Gee-0.8 list.vala
    error: Package `Gee-0.8' not found in specified Vala API directories or

  It should be --pkg gee-0.8 It is case sensitive!

  You also need the development files installed. For Ubuntu that would be
  something like
  apt install libgee-dev

    GIR files:
    You want to avoid GIR files to start with. They are GObject Introspection
    Repository (GIR)
    files that contain enough information about a C library's interface to
    generate bindings for
    various languages, including Vala. The Vala tool vapigen can then be used
    to generate a
    Vala Application Programming Interface (VAPI) file from the GIR. valac can
    do this automatically
    if a VAPI is not found.

  By using the capitalized version, --pkg Gee-0.8, valac tried to generate
  the VAPI for you by
  searching for the relevant GIR. It looks like that wasn't found either,
  probably because you
  don't have the development files installed. If you look at the files in
  the dev package you
  should see the difference in filenames.

  When starting out you want to focus on using VAPI files for interfacing
  with libraries.

  All the best,

  Al

vala-list mailing list
vala-list@gnome.org
https://mail.gnome.org/mailman/listinfo/vala-list

Additionally I read somewhere that build-essentials should be installed as well.

sudo apt install build-essentials


Question about installation: Does Re-installing ubuntu over previous Ubuntu partition delete files?

Your problem is with Microsoft. They decided that there would only be 1 OS on the drive, so when you loaded Windows, the bootloader from Windows has only that partition as bootable. There is a easy fix using Boot-repair.


Why was Banshee chosen to be the default for 11.04?

dv3500a's answer has links to the information. Here is an informative video from Gabriel Burt's talk at GUADEC that might give you some information that gives you an overview of some of the things that are nice in Banshee. Here are the slides.

I was at the session and here are some of the highlights:

The ability to change UIs from netbook to "normal". (It's handy to have one media player for both form factors)
A vibrant community of contributors (see the slides for numbers) who is willing to work with us closely.
An easy way to hack on extensions.
Follows the GNOME schedule.
Polished device support, including syncing of playlists to devices.
Video library support (though this is new and not very polished, maybe we'll hide it for 11.04)

Banshee has a bunch of other great features, but these were the ones we mostly discussed at this session.


Hi. Trying to move some files, but Nautilus progress bar won't come up. (Trusty 14.04)

External drives often get enormous memory cache for filesystem. In this case, if you copy files to/from hard drive, the copy process would immediately report success, then go on with actual copying in background. The telltale sign of this is a long unmounting. You may use these files as normal ones right after copying, even edit them, just don't plug off your external HDD without unmounting, which will make sure all background processes finished.
In Terminal, there is sync command, which will not return until backgound processes on all drives are finished.


Wireless not available Ubuntu Server 16.04.01

So, I gave iwconfig a shot and learned that wireless-tools is not installed in Ubuntu server by default, in the expectation that you will have an ethernet connection.

Because my laptop does not, the solution was to install wireless-tools manually. In order to satisfy all the dependencies I also needed to install libiw30

I also chose to install network-manager for ease of configuration. This included following a lengthy dependency tree and installing everything via usb, so I don't recommend it.

I was able to use nmcli to connect to my network using this tutorial.


How do I speed up Ubuntu 16.04 on my laptop?

First step: Decrease swap use. This is specially useful fow low RAM (2GB or less) systems.
You can check swap use by this command:

cat /proc/sys/vm/swappiness

This is generally set to 60.
To change the swappiness into a more sensible setting, type in the terminal

sudo nano /etc/sysctl.d/99-sysctl.conf

At the end of this file, append the following line.

vm.swappiness=10

Disable Unneeded Startup Applications.

launch startup application by typing startup in dash and to disable a startup application, simply uncheck it.

Disable Fancy Effects
 Use compizconfig-settings-manager to disable them

Install using

 sudo apt install compizconfig-settings-manager

and disable unwanted effects

Install preload

sudo apt install preload

This software memorize what applications you use most often and preload related libraries and binaries into memory so these applications can be launched faster.


Error while installing Ubuntu 18.04 alongside Windows 10

Did you resize your windows partition?
Try logging into windows, using Disk Management shrink your windows partition than try installing Ubuntu after.

Hopefully that works for you


Wine has been updated but also you can use it with PlayOnLinux which abstracts better IMHO and has pre-configurations.


Can't switch to my nvidia graphics card and i am not sure if system detects it

First install the NVIDIA drivers and NVIDIA Optimus to switch between intel and NVIDIA graphics.

Open a terminal and execute :

sudo apt-get update
sudo apt-get install nvidia-352 nvidia-prime
sudo reboot

You can see whether the NVIDIA card is in use (Kernel driver in use: nvidia) with this command :

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

The output reads like this :

lspci -k | grep -EA2 'VGA|3D'
00:02.0 VGA compatible controller: Intel Corporation 4th Gen Core Processor Integrated Graphics Controller (rev 06)
Subsystem: CLEVO/KAPOK Computer Device 3501
Kernel driver in use: i915

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

Open NVIDIA X Server Settings -> PRIME Profiles and switch between intel and NVIDIA graphics.


Installing adobe-flashplugin from Canonical Partner should give you Flash plugins for both Firefox and Chromium.


How can I find a folder that starts with a .?

Like kos said:

In nautilus you can use CTRL + H to show hidden files.

Or you can use terminal:

nano /home/tim/.config/spotify/Users/tim/prefs

or if you want to use gedit to edit to file:

gedit /home/tim/.config/spotify/Users/tim/prefs


Gnome: Video drivers on Dell XPS 9550 with 4K UHD screen

Switching the intel driver from SNA to UXA helped quite a bit. No more weird artefacts, though still some freezing when switching modes.

I had a similar experience with the nvidia-361 driver.  I did get it working on a external HDMI monitor, but it was not always reliable.

Section "Device"
   Identifier  "Intel Graphics"
   Driver      "intel"
   Option      "AccelMethod"  "uxa"
EndSection

Add this to xorg config by adding to a file in /usr/share/X11/xorg.conf.d


How do we add DNS servers to our VPN network definitions?

I have not tried this but it may help you. From the Ubuntu Server Guide

sudo cp /usr/share/doc/openvpn/examples/sample-config-files/server.conf.gz /etc/openvpn/
sudo gzip -d /etc/openvpn/server.conf.gz

  Edit /etc/openvpn/server.conf changing the following options to:

local 172.18.100.101
dev tap0
up "/etc/openvpn/up.sh br0"
down "/etc/openvpn/down.sh br0"
;server 10.8.0.0 255.255.255.0
server-bridge 172.18.100.101 255.255.255.0 172.18.100.105 172.18.100.200
push "route 172.18.100.1 255.255.255.0"
push "dhcp-option DNS 172.18.100.20"
push "dhcp-option DOMAIN example.com"
tls-auth ta.key 0 # This file is secret

  Then

cd /etc/openvpn/easy-rsa/
source vars
./pkitool hostname

  Replace hostname with the actual hostname of the machine connecting to the VPN.
  Copy the following files to the client:

/etc/openvpn/ca.crt
/etc/openvpn/easy-rsa/keys/hostname.crt
/etc/openvpn/easy-rsa/keys/hostname.key
/etc/openvpn/ta.key


Why isn't utorrent working? How do I remedy this problem?

This happened to me, after a few tries, this is what helped me:

I check how many servers were running with the command ps -e
Then, ended all the server process with killall -v utserver
Then, I start it again with utserver -settingspath /opt/utorrent-server-alpha-v3_3/ & Notice the & at the end, to tell the terminal, to process it in the background. Also, notice the ending / slash, so it knows it true path.

You may want to check it, running again ps -e.

Note: I do have to run the last command, every time I turn on my computer. But that's logic, cause it's a service we need to start.


14.04 LTS - Nvidia 331 Dual Monitors not working any more after updating

Any reason you have not connected both monitors to the GTX660 ?

Can you open the nvidia X server configuration GUI, check both monitors are listed, are enabled and are positioned side by side.


Error During building of a trial Ubuntu App using Cordova

I finally found the solution to the above. It seems the cordova-ubuntu ppa is to blame, which comes with an earlier version of cordova(3.6 or something). I un-installed it and installed cordova via node.js/npm package. It installed a newest version of cordova (6.0.0) which works perfectly on 15.10 desktop and the 15.04-armhf on the phone.


Exit graphical X session and getting back to TTY

killall xinit

works ok. Not sure you're going to find a generic way to gracefully close all possible sessions.

For some reason if I start a unity session from TTY, and then run

unity

in a terminal, it seems to close it fairly gracefully.


Eclipse colour scheme is terrible in Ubuntu

That color is controlled by your gtk theme, which is "Ambiance" by default in Ubuntu.

As a quick workaround to this problem, you can try changing the color to a darker one. To do this, open a terminal and use the below command

gsettings set org.gnome.desktop.interface gtk-color-scheme "bg_color:#D7D7D7;"

The color value is a darker one than the default. You can use your own color value. To generate hex value of color, you can use agave .

Also, you may want to change the theme to a darker one. I personally like the "greybird" theme included in the Lubuntu. You can install the theme by using this command:

sudo apt-get install shimmer-themes

or using this link shimmer-themes

After installation, change the theme using Ubuntu-tweak:

How do I install Ubuntu-Tweak?

Hope this will make eclipse humanly readable again. :)


How to download certain folders from url

You can use the -i flag, that will read the list of URLs you want to download from a file. So if you have file.txt with this content:

https://physionet.org/physiobank/database/challenge/2018/training/tr03-0005
https://physionet.org/physiobank/database/challenge/2018/training/tr03-0029

and use wget other_options -i file.txt then you will download just those two, the first two folders. Note that with -i you don't need to pass an URL since each URL is going to be read from the file.


How do I know if I changed a setting in winetricks

Using the PPA from Wine and at least starting with Wine 1.4 I can confirm that Winetricks now saves the state of each setting. If they are installed they will show with a marked checkbox. The image below shows for example the settings I have installed:

Thanks to Christian for pointing me out a couple of minor details:

If the package installed needs a manual installation (Like ie6) in all the cases I have tried it never appears checked.
If the package has multiple installs (like allcodecs which installs several apps) and one of them fails, it does not show marked because it thinks they all failed.
Some packages show if you do the install using winetricks with the GUI option (winetricks --gui) and not when you do the install through the terminal.
There might be a need to delete the .wine folder, purge all related packages and even delete the ones stored in cache. Basically start from scratch. This at least cleared a couple of issues I have back then.


I am using Transmageddon from Ubuntus bigg bunch of software.
If I can play a video on my mashine, but the TV complains, I use this wery easy point and click codec converter, it seems to use every codec it finds installed and do a great job.
So get it from the software center, and start transcoding the offending mediafiles!


How to get cron to check every day if an item goes on sale

You could use wget to get your web page with the search results. This doesn't work with google (they insist on filling their search box) but works on bing. So something like that can be a starting point:

wget "http://www.bing.com/search?q=ikea+arkelstorp&go=Submit+Query&qs=ds&form=QBLH" -O /tmp/IKEA_ARKELSTORP.html

This will save the search result in file /tmp/IKEA_ARKELSTORP.html and you can continue from there. I am not sure how useful it will be for you, the results are fairly javascript heavy.

Limiting yourself to a shell script is quite a severe restriction. If you are willing to learn a bit of python check out this easy intro to mechanize. It is specifically designed to do web scraping and will make your life a lot easier.


Giant battery consumption with dual graphics solution (only i-gpu working)

Ubuntu turns on Nvidia by default, despite it showing as Intel M, so your best bet is to try switchable graphics (at your own risk though).

Using Ironhide, you can manually switch to using Intel graphics.

Also note that there is a current regression in Ubuntu Oneiric which causes upto 30% more power consumption on Sandy Bridge laptops (acknowledged in Ubuntu Release notes).

update: Canonical is testing Oneiric (and Precise) Kernel's with the Matthew Garrett ASPM patches which brings down the battery consumption to Maverick level's test it over here


Command to get the list of files deleted by apt purge but not by apt remove?

If the only difference between remove and purge are the config files and only the config files (still not 100% sure about that), this should answer my question:

dpkg-query --showformat='${Conffiles}\n' --show <package>

Am I wrong?


Avro is installed, but bangla writting is still not coming

try this command and then restart ibus. Restart your PC if needed.

rm ~/.candidate-selections.json
ibus restart


I just spent my morning recovering from just such a problem -- My battery in my laptop died while in the process of an update (yeah I know I'm an idiot! O_o)... I was getting the same error message:

Fatal Python error: Py_Initialize: Unable to get the locale encoding
EOFError: EOF read where not expected
Aborted (core dumped)

The way I fixed it is first:

sudo dpkg -P --force-all python3.2-minimal

sudo apt-get -f install

Which will re-install python3.2-minimal, but will still have errors from other packages -- a summary of errors will be shown at the end such as:

Errors were encountered while processing:
 python3-gi
 ufw
 python3-problem-report
 python3-apport
 apport
 python3-pykde4
 apport-kde
 ubuntu-release-upgrader-qt
 python3-aptdaemon
 python3-aptdaemon.pkcompat
E: Sub-process /usr/bin/dpkg returned an error code (1)

After that, simply take the list one-by-one:

sudo dpkg -P --force-all <package>

sudo apt-get -f install

Once you've purged and re-installed all packages with errors, the system should be back to normal and you can do a

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

Just to be sure everything is updated properly.

Hope that'll help someone in the future. :-)


Have you looked at upstarts documentation? I strongly suggest to you to skim through it. It can be found here.

One simple way could be to delay some between each start or use a post-start script to delay until your service is up before you start next instance? Have a look at some of the examples to get some ideas how to handle it. Eg. 6.22  6.14.2 ++ http://upstart.ubuntu.com/cookbook/ You can also extend that script to suit your needs?


Path of the flags XFCE (layout keyboard)

The .svg files for the country flags in xfce4 are located in the /usr/share/xfce4/xkb/flags/ directory.


Wireless keyboard disconnects and then auto connects in ubuntu 20.04

With google search, came across the page
which mentioned the solution for HP laptop but when I applied the solution from there, it worked even on my Dell laptop.

HP laptop had an issue with keyboard key getting pressed by itself. It started taking a screenshot every now and then. Once the screenshot shortcut key was disabled in Ubuntu keyboard settings, it started playing with the scroll lock key.
To disable the laptop's built-in keyboard in Ubuntu, first you need to identify the device ID for the keyboard.
If you are connecting from a remote system via SSH, you need to run:
export DISPLAY=:0

Now run xinput –list to get a list of all input devices.
hostonnet@pc4:~$ xinput --list
⎡ Virtual core pointer                      id=2    [master pointer  (3)]
⎜   ↳ Virtual core XTEST pointer                id=4    [slave  pointer  (2)]
⎜   ↳ SynPS/2 Synaptics TouchPad                id=11   [slave  pointer  (2)]
⎣ Virtual core keyboard                     id=3    [master keyboard (2)]
    ↳ Virtual core XTEST keyboard               id=5    [slave  keyboard (3)]
    ↳ Power Button                              id=6    [slave  keyboard (3)]
    ↳ Video Bus                                 id=7    [slave  keyboard (3)]
    ↳ Power Button                              id=8    [slave  keyboard (3)]
    ↳ HP Truevision HD                          id=9    [slave  keyboard (3)]
    ↳ AT Translated Set 2 keyboard              id=10   [slave  keyboard (3)]
    ↳ HP WMI hotkeys                            id=12   [slave  keyboard (3)]
    ↳ HP Wireless hotkeys                       id=13   [slave  keyboard (3)]
hostonnet@pc4:~$

The xinput command should be run as the user that runs the GUI (Ubuntu logged in user).
The one above list what we need is:
↳ AT Translated Set 2 keyboard              id=10   [slave  keyboard (3)]

The ID is 10.
To disable the keyboard, run:
xinput set-int-prop 10 "Device Enabled" 8 0

To enable it, run:
xinput set-int-prop 10 "Device Enabled" 8 1

Method 2: Disabling on boot
Edit file /etc/default/grub.
vi /etc/default/grub

Find:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"

Replace it with:
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash i8042.nokbd"

Regenerate grub.cfg with:
sudo update-grub2

Reboot the laptop. The built-in keyboard will be disabled by default. There's no need to run the xinput command and manually disable it each time.


Any application wherein i can create photo mosaic

I would recommend http://mosaically.com not just because it is mine ;) but it lets you create and share high-resolution zoomable photo mosaics online.

I realize it may not be "software that you install" strictly speaking as it's a web application, but it is an alternative that serves the same purpose.


You can reinstall the Software Center with a fresh start to all its systemwide configuration files by issuing this command in the Terminal (Ctrl+Alt+T):

sudo apt-get update; sudo apt-get --purge --reinstall install software-center software-properties-common software-properties-gtk

(You can copy that whole thing to the clipboard, paste it into the Terminal, and press enter. If you enter it manually--which I recommend against--then please take note to only press enter at the end; there is no line break in the middle, it's just too long to be displayed on one line.)

That command is written so that it also completely reinstalls the packages that provide the Software Sources window, which is at least as likely to be responsible for any problems relating to disabling a PPA as is the Software Center itself.


ERROR MOUNTING a single internal HDD used as EXTERNAL via USB PORT

Try to mount it with -ro (read-only) and if that also fails check with dmesg | grep sd | less for error messages regarding your drive.

mount -t "ntfs" -o "uhelper=udisks2,nodev,nosuid,uid=999,gid=999,ro" "/dev/sdc1" "/media/ubuntu/DYNAMIC

In case of really severe issues, there is usually something like "sense key" in those lines along with an error message.


Laptop boots directly to Windows, Ubuntu alredy installed and refind not working

HP BIOSes are a bit weird, I've been struggling with that, too.

Does your BIOS Setup look like this (found on newer HP ProBooks), then follow below instructions. This was the only way I managed to get Ubuntu to boot on my laptop with Secure Boot enabled.

In the BIOS setup, under System Configuration → Boot Options, you should find the option Customized Boot (Bottom checkbox in below picture). Activate it.

Then scroll a bit further down, to the boot order. Here, you should be able to put customized boot before OS Boot Manager.

Then go down a bit further, where you'll find the option to set up the Customized Boot. There you can select Add. In the now opening text entry, enter the following line:

EFI\ubuntu\grubx64.efi

Press enter, save the settings, and quit the BIOS setup. Then your computer should boot into GRUB, from where you can select the OS.

As for rEFInd, I am not doal booting and I don't know it very well, but I've read already that rEFInd stores its EFI file as the GRUB EFI, so just try it. If you manage to boot Ubuntu, and the rEFInd screen doesn't show up, browse /boot/efi for the correct EFI file.


Where can I find documentation on the output of dmesg?

dmesg does not generate the messages. All it does is keep a standard log of what other things tell it.

Usually, things that write to dmesg will include some sort of identifier to show what they are. In this case, your identifier is usb. We can then use our friend Google to find the specific source of the message. In your case, error 71 refers to this:

#define EPROTO      71  /* Protocol error */

If you want to find sources for other messages in dmesg, you need to look at what wrote the message there, and then consult that system's documentation.

For example, if you have something like this, you should look at the documentation for the EXTFS modules:

[37734.973627] EXT4-fs (nvme0n1p2): re-mounted. Opts: block_validity,barrier,user_xattr,acl

The docs will then provide the required information to trace the error. dmesg only aggregates all of these messages.


Window borders look weird after installing nvidia drivers on Plasma 5.16

Well, this is pretty awkward! I remembered the Composition tab in System Settings > Display and Monitor > Compositor and changed the rendering backend from OpenGL 2.0 to OpenGL 3.1. Did a reboot, and everything works as intended with nVidia drivers! Screen 1 Screen 2

Pretty embarassing, but I hope this helps someone out there!


How to decode an image string using base64 in command line?

The utility base64 reads its input either from a file whose name is supplied as an argument, or from standard input. It never reads its input from a command line argument. In your case, to decode a string stored in a variable, you should supply the string on the standard input of base64.

If you are using Bash, you may use a here-string:

base64 -d <<< "$myImgStr" > image2.jpg

If your shell does not accept here-strings, you can always use:

echo "$myImgStr" | base64 -d > image2.jpg

(Note the doublequotes around "$myImgStr". You should always doublequote variable expansions unless you have a good reason not to.)


Issue when sudo something after a hostname change

Have you defined your new hostname in your /etc/hosts file?

When changing your hostname, you need to alter it in both the /etc/hostname and /etc/hosts files.  And once you've done that, either reboot or restart the hostname service:

sudo service hostname restart


How can I check my favorated commands from the terminal?

Open your terminal and type as

history | awk '{a[$2]++} END { for  ( i in a ) { print a[i] " " i}}' | sort -rn | head

Then that will give you most executed commands in your terminal.

For example:

raja@debian:~$ history | awk '{a[$2]++} END { for  ( i in a ) { print a[i] " " i}}' | sort -rn | head
45 sudo
20 firefox
10 ./configure
9 ls
9 ./hotspot.sh
9 cd
8 nano
6 su
5 man
4 vmstat


Could not find any downloads that satisfy the requirement dateutil

Are you thinking of python-dateutil? pip needs you to be specific so either search PyPI or use pip search dateutil.

Important note: python-dateutil is packaged and part of Ubuntu. It is depended on by a large number of packages (run apt-cache rdepends python-dateutil to see). If you install over the top of this with sudo pip into your site-packages, you may break Ubuntu.

So you could just sudo apt-get install python-dateutil but if you need a later version of python-dateutil, I strongly recommend using Virtualenv to create a local Python environment that you use for your application that the rest of Ubuntu doesn't need to know about. Infinitely safer than overwriting pakcage-installed file.


how to fix Unable to open MTP device '[usb:004,010]' in ubuntu 1V

In the terminal, type:
[To open a terminal window, press ALT+CTRL+T; to close it, press CRTL+D]

$ sudo apt-get install gmtp

It's not perfect, but better than nothing.Tip: When you're successfully connected, enable "folder view" in the menu.


How to move between 2 very different directories in the terminal?

I'm not sure if I understood, but you want a console file manager so you could navigate your folders in two panels. You could try with Midnight commander.

Install it with:

sudo apt-get install mc


Ehhh, never reboot like that.  You likely corrupted your HDD, and you need to run this at the command line:

sudo fsck -a /dev/sda

If that runs and output no errors then your HDD is OK.  If it outputs errors, then it should automatically attempt to fix them.  If it can, all should be well.

If it didn't output any errors and still doesn't work, then please let me know and I will help you address the situation in comments below.


I know this question is quite old (more than 1 year old), but for posterity, let me share the tip as originally described in this blog post (not mine). In summary, this one line does everything you want:

export TIME_STYLE=long-iso

stick that line into /etc/profile, or a file in /etc/profile.d/, or even in ~/.bashrc, and you're good to go.


Remove xscreensaver and install gnome-screensaver which has a more polished look:

sudo apt-get remove xscreensaver
sudo apt-get install gnome-screensaver

You can also set a shortcut to lock the screen with the keyboard:

Start > Settings Manager > Keyboard > Application Shortcuts > Add

Command: xflock4

ShortCut: <Super>l   ; (e.g. press the "Windows key" + l)

  NOTE: The only potential downside to this is that gnome-screensaver will pull the gnome dependencies which in a very minimalistic desktop might not already be present. But on most average systems the gnome libraries are already installed anyway so there is no overhead.


How do I create a live USB installer for UEFI/EFI systems that reads and saves persistence changes?

This is a bug, specifically bug 1159016. The solution is described in this AskUbuntu post. Basically you just have to add the word persistent in boot/grub/grub.cfg after creating the live USB:

menuentry "Try Ubuntu without installing" {
    set gfxpayload=keep
    linux   /casper/vmlinuz.efi persistent file=/cdrom/preseed/ubuntu.seed boot=casper quiet splash --
    initrd  /casper/initrd.lz
}

EDIT:

As you have a large 16GB drive, I would also suggest to split the USB drive into two partitions, a ~6GB FAT32 one for the live USB + persistence, and a 10GB ext4 one for any other data you want to store on the stick. You could also use a separate partition instead of a casper-rw file if you need more than 4GB of persistence, but then usb-creator-gtk will not help you create it. (EDIT: see here on how to do that.)

Unfortunately, when resizing FAT32 partitions you'll run into another bug (bug #1313600), so I suggest you create the partitions manually (6GB FAT32, 10GB ext4) before using usb-creator-gtk:

Run GParted.
Format the whole USB drive, deleting all partitions.
Create a new FAT32 partition at the beginning of the drive, with a size of ~5500MB.
Create the live USB using the FAT32 partition with usb-creator-gtk.
Finally, as I am running an UEFI system I needed to fix this bug as well by adding the word persistent in boot/grub/grub.cfg:

menuentry "Try Ubuntu without installing" {
    set gfxpayload=keep
    linux   /casper/vmlinuz.efi persistent file=/cdrom/preseed/ubuntu.seed boot=casper quiet splash --
    initrd  /casper/initrd.lz
}


New installation not letting me boot to windows

Open a terminal and run sudo update-grub which should search all connected hard drives and find the Windows loader, thus adding it to grub. Normally this would have been discovered during the installation of Ubuntu by default, however.


Successful install  with lubuntu 15.10

Lesson-learned: sometimes an older version will work when the newest does not.


I had a similar issue with awful noise after sending a message in Skype 4.2.0.11 on Ubuntu 13.10. I was able to solve it by editing /usr/share/applications/skype.desktop and updating the exec command to:

Exec=env PULSE_LATENCY_MSEC=60 skype %U


Use rygel (sudo apt-get install rygel).

Configuration

Install necessary things:
sudo apt-get install rygel rygel-preferences pavucontrol paprefs gupnp-tools

Due to bug #827030, we can't autostart rygel easily. But we can do this:

  Install, start rygel-preferences, exit rygel preferences.
  Start Rygel preferences, untick the "Share Media through DLNA" button, exit Rygel preferences, then start Rygel preferences, tick the checkbox and exit it again and it should work.

Note: How to fix stolen from comments on the bug report

Now, enable the necessary PulseAudio module:
pacmd load-module module-http-protocol-tcp

To do this automatically, add the line load-module module-http-protocol-tcp to /etc/pulse/default.pa, or do this: sudo su -c 'echo 'load-module module-http-protocol-tcp' >> /etc/pulse/default.pa

Run paprefs, select the "Network Server" tab and enable "Make local sound devices available as DLNA/UPnP Media Server".

Browse the DLNA network on a client device (Android phone, Smart TV, etc.). You will see "Audio on $hostname" -> Output Devices -> Built-in Audio Analogue Stereo (the device name will likely change depending on the audio hardware in your computer). You should hear on your client device whatever is currently being played via that sink.

Guide taken from, and full guide available, if that doesn't work here


Returning from Ubuntu SDK full screen mode

Just Press Shift+Ctrl+F11 to switch back to the normal mode


added a comma by mistake after a command - what did it do?

It just grepped for the string >, instead of >
 ~> bash -xc 'echo foo | grep "foo"',
+ echo foo
+ grep foo,

The exit status was non-zero because grep did not find a match.
 ~> bash -c 'echo foo, | grep "foo"',
foo,
 ~> echo $status
0


I can't really reproduce this but you may mute system sounds.


Ubuntu 18.04 LTS - Tower Cannot Connect to New TV

There is a high probability that this is an EDID issue.  Tower and new tv find no agreement on the resolution to use.  I would try to save the Edid information of the old tv and force the tower to use this edid when connected to the new tv, or force the resolution.  How to do this is more or less described here :
Using a saved EDID so Ubuntu boots to correct resolution when TV is turned off


Poor sound quality from laptop's built-in speakers only on Ubuntu

The same thing happened to me when I was using Ubuntu for the first time. The reason for me was that Ubuntu had the volume of speakers set to a too high value. Solving this problem is very easy:

Using the sound indicator, open Sound Settings and set the sound volume slider at "unamplified", as shown in the image:

I hope this solves the problem.


Need a little help with dconf formatting

To get the current settings (list) in a terminal, it is:

gsettings get com.canonical.Unity.Lenses always-search

which outputs a list (for example):

['applications.scope', 'music.scope', 'videos.scope', 'files.scope']

To set a (changed) list:

gsettings set com.canonical.Unity.Lenses always-search "['applications.scope']"

So change get to set, put the list between quote marks, items in the list between (single) quotemarkes.

The format is pretty much (exactly) what you see in dconf editor:

When you set the list via terminal, just put it between quote marks.


How to install QUCS (Quite Universal Circuit Software) on ubuntu 13.04?

https://launchpad.net/ubuntu/raring/+source/qucs says

  There is no current release of this source package in The Raring
  Ringtail. You can still report bugs, make translations, and so on, but
  they might not be used until the package is published.

So, if you want to install qucs on Ubuntu Raring (13.04), please do the following

If you are using 64 bit machine

wget http://launchpadlibrarian.net/86130584/qucs_0.0.15-1.1_amd64.deb
sudo dpkg -i qucs_0.0.15-1.1_amd64.deb

If you are using 32 bit machine

wget http://launchpadlibrarian.net/86124276/qucs_0.0.15-1.1_i386.deb
sudo dpkg -i qucs_0.0.15-1.1_i386.deb


Use different screen resolution in vncviewer session from the server

What happens if you try
     vncserver -geometry 1366x768

instead of sticking with the vino configuration?  It's not the same as altering the system screen resolution, only the resolution put out by vnc.


How do I create timestamped backups for certain files I edit?

Automatic time-stamped backups of a (any) specific file

If you are not afraid of compiling a vala file, the snippet below can be used. The advantage is that it is signal-based (using FileMonitor) and resource-consumption is zero. Furthermore, you don't need an extra manual action.

How it works

Just run the executable with the watched file and the targeted directory (to save the backups to) as arguments, e.g.

'/home/jacob/Desktop/watch_out' '/home/jacob/Desktop/test' '/home/jacob/Desktop'

Each time the file test is saved (so changed) on disk, a backup like:

2019-08-29_09-14-26_test

will be created.

N.B just keep it running, it will automatically create the backups (!)

The code

/*
this snippet will watch a specific file (args[1]) for changes, make a time-
stamped copy into a set directory (args[2]). The advantage is that any file
can be watched, independent to the application it is edited with.
have fun!
Jacob Vlijm
*/

namespace watchout {

    File watched;
    string watched_fname;
    string watched_fpath;
    string target_fpath;

    public static void main(string[] args) {
        string watched_file = args[1];
        target_fpath = args[2];
        watched = File.new_for_path(watched_file);
        string[] fdata = getnamedata(watched_file);
        watched_fpath = fdata[0];
        watched_fname = fdata[1];
        MainLoop loop = new MainLoop();
        try {
            FileMonitor monitor = watched.monitor(FileMonitorFlags.NONE, null);
            monitor.changed.connect(dosomething);
            loop.run();
        }
        catch (Error e) {
        }
    }

    private string[] getnamedata (string watched_file) {
        string[] watched_data = watched_file.split("/");
        int len_data = watched_data.length;
        string path = string.joinv("/", watched_data[0:len_data - 1]);
        string fname = watched_data[len_data - 1];
        return {path, fname};
    }

    private void dosomething(
        File file, File? otherfile, FileMonitorEvent event
    ) {
        // event types:  https://valadoc.org/gio-2.0/GLib.FileMonitorEvent.html
        if (event == FileMonitorEvent.CHANGES_DONE_HINT) {
            makebackup();
        }
    }

    private void makebackup () {
        var now = new DateTime.now_local();
        string datestring = now.format("%Y-%m-%d_%H-%M-%S");
        string targetstring = target_fpath.concat("/", datestring, "_", watched_fname);
        File target = File.new_for_path(targetstring);
        try {
            watched.copy (target, 0, null, () => {
            });
        } catch (Error e) {
            print ("Error: %s\n", e.message);
        }
    }
}

Setup

Install valac(to be able to compile)

sudo apt install valac

Copy the snippet above into an empty file, save is as watchout.vala
Compile it with:

valac --pkg gio-2.0 /path/to/watchout.vala

Run it as described in How it works


If you want to change the password of the currently logged in- user, change the password with:

passwd

not

sudo passwd

if you want to use the command sudo passwd, you should tell the shell who's password it is that you want to change:

sudo passwd username


Ubuntu 16.04.2 LTS asks for password and login before installing

During the install of a new Linux machine, you need to provide your-user-name (e.g. maxim) and your favorite password (what-ever-you-like).

You'll need to remember the username/password as you'll use them when you'll log-into the computer, and will install software...etc.

tutorial-install-ubuntu-desktop

  Login details

  Enter your name and the installer will automatically suggest a
  computer name and username. These can easily be changed if you prefer.
  The computer name is how your computer will appear on the network,
  while your username will be your login and account name.

  Next, enter a strong password. The installer will let you know if it's
  too weak.

  You can also choose to enable automatic login and home folder
  encryption. If your machine is portable, we recommend keeping
  automatic login disabled and enabling encryption. This should stop
  people accessing your personal files if the machine is lost or stolen.

  If enable home folder encryption and you forget your password, you
  won't be able to retrieve any personal data stored in your home
  folder.


Go to BIOS Menu and set the preference to boot from usb. then it will load from usb.

and yes to boot from usb we need to press key, try function key to load.
When it get loaded choose language preference and go to DO SOMETHING ELSE to dual boot ubuntu with your current OS.


Recovering data from a partition without the passphrase

The entire point of encryption is to keep unauthorized users out of files. This authorization is usually done via password. It is very likely all data on that drive (especially if it suffered a failure) should be considered lost.

However, for the sake of knowledge, you may theoretically launch a brute force attack against this drive:

First and foremost (as with any failing hard drive), create a full disk image using the dd command. If this fails, you may have luck with ddrescue and other such emergency recovery utilities. Once you have an image, get rid of the hard drive. It's dead.
Use a tool like John the Ripper or bruteforce-luks to attempt to brute force the encryption password. This will take a very long time, as decoding the master key for a LUKS-encrypted drive takes time. See this question on Security.SE, where a few passwords a second is considered good.

All in all, the data there is lost. In the future, ensure you have available (and working!) backups available to you. Also ensure that you either have an emergency recovery encryption key, or have your standard LUKS password written down and stored in a safe location (e.g. bank security deposit box).

See the Red Hat documentation for a couple other approaches (if you have a second keyslot, a master key, or the drive is still open). In your case, however, it seems unlikely that any of those apply.


What is the difference between scrub and shred?

Both commands overwrite data using patterns. Which to use in what situations will most certainly be a matter of opinion, I would likely shred a file and scrub a disk, However as that's just my opinion, the following information may be useful to you.

 SHRED:  Note  that shred relies on a very important assumption: that the file system overwrites data in place.  This is the tradi‐
   tional way to do things, but many modern file system designs do not satisfy this assumption.  The following  are  examples  of  file
   systems on which shred is not effective, or is not guaranteed to be effective in all file system modes:

   * log-structured or journaled file systems, such as those supplied with AIX and Solaris (and JFS, ReiserFS, XFS, Ext3, etc.)

   * file systems that write redundant data and carry on even if some writes fail, such as RAID-based file systems

   * file systems that make snapshots, such as Network Appliance's NFS server

   * file systems that cache in temporary locations, such as NFS version 3 clients

   * compressed file systems

   In  the  case  of  ext3 file systems, the above disclaimer applies (and shred is thus of limited effectiveness) only in data=journal
   mode, which journals file data in addition to just metadata.  In both the data=ordered (default)  and  data=writeback  modes,  shred
   works as usual.  Ext3 journaling modes can be changed by adding the data=something option to the mount options for a particular file
   system in the /etc/fstab file, as documented in the mount man page (man mount).

   In addition, file system backups and remote mirrors may contain copies of the file that cannot be removed, and  that  will  allow  a
   shredded file to be recovered later.

Source 'man shred'

Scrub:

Image Source: Software Center


Unable get my wireless network connection under awesome window manager?

A program called NetworkManager has been the default network configuration mechanism on Ubuntu for some time now. Several front-ends for the desktop-agnostic backend exist, but primarily there are cli, Gnome, and KDE variants. Wikipedia lists several NetworkManager front ends. GTK-based window managers usually use nm-applet, and an independent wiki gives instructions on using nm-applet with the awesome window manager.

(incidentally, that link is hosted through naquadah.org, and I'm in the middle of a Stargate episode :P)


Ubuntu installer asks if I want to install Ubuntu INTO Windows, but that's not what I want!

Looks like you're installing from within Windows using Wubi.

If you want to dual boot alongside Windows, its always a better idea to create a separate partition and install. Copy the Ubuntu setup on a flash drive/CD and boot using that, follow on-screen instructions and install on separate partition.


Note: Remove the blacklisting for the iwlwifi driver.
To switch between wifi adapters, or only have one specific adapter connect, do a variation like this...
Example:
Let's assume that you have two different wireless networks, wifi-a and wifi-b.
Let's assume that you have two different wireless adapters, wlan0 and wlan1.
Edit all wireless connection profiles for all local wireless networks, and un-check Connect automatically.

Edit the wifi-a connection profile, and change the MAC address to wlan0.
Edit the wifi-b connection profile, and change the MAC address to wlan1.
If you always want one particular wireless interface to always connect at boot/login time, then reselect the Connect automatically for the desired profile.

By using these two settings, you can tailor the exact desired configuration.
You can also add the gnome-shell extension Disconnect WiFi, which can be found at https://extensions.gnome.org/extension/904/disconnect-wifi/.


compiled/installed kernel 3.5 in 12.04 usb keyboard/mouse not working at boot log on screen

Try installing 12.04 making sure to check the "download updates while installing" option. Touchscreen seems to work fine for me then.


Apache Not Accepting a Path in My Home Folder

What's in your error_log?

I don't think home folder encryption should be a problem.  I have /var/www/ symlinked to locations in my home folder, and with Options +FollowSymLinks in the site config it works just fine.

Just a couple quick notes - you can sudo chgrp -R www-data <path>; sudo chmod -R g+a <path> instead of setting permissions to 777 - this is a good habit in general and important if you're on a shared host.
I'm not sure what you mean by "I want whatever change I make to be immediately reflected" but I'm guessing you mean keeping a working copy in /home and pointing Apache at /var/www - this isn't necessary/required.  You can use ln -s like I've described above or point Apache directly at your home folder as you're trying to do.


How to use backup files in deja-dup when I can only operate in terminal

Just type:
man deja-dup
in the terminal and read the manual of deja-dup.
what you need is probably:
deja-dup --restore [FILES?]
Between the bracket type the whole address of the Deja-dup file/s


I accidentally made my terminal open another terminal when it starts. How can I fix it?

I don't have 10.04 (Lucid) to test this on, but would suggest ..

login in text-only mode, to this user, and type:

sudo rm -r ~/.gconf/apps/gnome-terminal

When next login, Gnome Terminal should re-create default settings.


VNC Viewer: Invalid endpoint: port not correctly specified

Just had the same issue with VNC Viewer on macOS-Mojave. Surprisingly I found that dropping vnc:// made it work,

e.g. server:port

not vnc://server:port


How can I read Skype's menus on a dark theme?

Click on the skype symbol on the bottom left. Click on Options, six entry if you are not able to see it at all.

It will open a new window, on the right there is a combo box labeled "Choose Style", click on it and choose Desktop Setting. Restart Skype.


Those default limits are hardcoded into the kernel source. Those limits are set for the init process by the kernel and other processes inherit it from init. See here.

Why you get an error when trying to set the number of open files to unlimited is likely because the system-wide setting is not unlimited, check it withcat /proc/sys/fs/file-max. See here:

  file-max & file-nr:

  The value in file-max denotes the maximum number of file-
  handles that the Linux kernel will allocate. When you get lots
  of error messages about running out of file handles, you might
  want to increase this limit.

You can change that system-wide limit if you run e.g. echo 300000 > /proc/sys/fs/file-max as root, or with sysctl -w fs.file-max=300000 as root. To make those changes permanent add a line similar to the following

fs.file-max=300000

to the /etc/sysctl.conf file, e.g by running echo "fs.file-max=300000" >> /etc/sysctl.conf as root.


If you can wait until February 6th then Ubuntu 12.04.4 will be released which contains all of the latest 12.04 updates as well...  That way you will have an up-to-date fresh install when you take your freshly burnt CD or Flash Drive home to play with...


Where is "Project Structure" in Android Studio 4.1

I'm just through with the same issue. Probably this should solve your problem too.
Go to Tools > Flutter > Open for Editing in Android Studio
You will be asked to open the Project in the same window or new window. Choose any. Another window will open. There in the File menu, you will find Project Structure.
After you are done with your work you can move back to your original project by going to File > Open Recent


zsh: command not found after npm install in ubuntu

I solved the

zsh: command not found

issue for the npm libraries by setting the path in ~/.zshrc

Setting the following path in ~/.zshrc solved my issue

echo 'export PATH=~/.npm-global/bin:$PATH' >> ~/.zshrc


Not by itself, but nmap provides useful information about target systems and networks that can be the starting point to actually hacking them. Therefore, people don't take kindly to being scanned.

If you're doing penetration testing, remember: Always ask for permission first. Gratuitous penetration testing could see you sued.

See also:

How should I tell an organisation that they are vulnerable when I wasn't given permission to check?
Penetration testing against an ignorant target - Is it legal?


here what I did,
using kate in KDE , Made a nm.sh file with below code

#!/bin/bash
nm-applet

Then , did sudo chmod +x nm.sh from terminal.
added this sh file to KDE startup.
Now on every reboot I get wifi / Network icon in tray.

My screen shot


How can I accept Microsoft EULA agreement for ttf-mscorefonts-installer in the preseed file?

The following line works for me when preseeding Xubuntu 12.04 LTS:

ttf-mscorefonts-installer msttcorefonts/accepted-mscorefonts-eula boolean true


Virtual Box Menu Bar not appearing even after using fixes

I cobbled together this fix for Virtual Box 6.0.8. when I accidentally set the menu bar to not display.

Go into Full-screen mode by pressing Host_key+F. Host_key is the right Ctrl key on my laptop.
A tiny sliver of the menu bar is visible at the bottom or top of the screen (menu is hidden by default in full-screen mode). Hover over or click on the sliver to display the menu bar.
Go to the Machine menu and select Settings.
Select "User Interface" from the Settings dialog box.
Select the menu bar checkbox and press OK.
Close the virtual machine, saving state.
When you restart the menu should reappear.

Screenshots of the above steps are shown below.

Step 1

Step 2

Step 3

Step 5


Errno 13 Permission denied: '/var/lib/apt/lists/

Yes, if you run BleachBit as user you don't have write access to the apt archives then you cannot execute that kind of cleaning. Then you have two options:

or you disable the apt cleaning
or you run BleachBit as root (in the menu there should present that options ---> BleachBit (as root)

I suggest you the first option because you don't need to clean the apt archive and also it's a bad idea run BleachBit as root.


clonezilla "the volume group setting is not found"

Explanation:
The "The volume group setting is not found" error is thrown because there is a "lvm" flag (or in GParted it will display as "lvm2 pv") set for a partition AND there is no actual Volume Group setup in that partitions file system.
Which then results in the misleading error msg from Clonezilla "unable to write to device".

Solution:
Once you create the VG/LV on that partition OR remove the "lvm" partition flag, you no longer will receive these error message and will be able to write to your drive.


Given some number, use grep to find where the number belongs in a numbered list?

Maybe not what you wanted, but as you are actually trying to insert a value, I'd personally append the number to the list and then use sort -n to bring things into the correct order.

Such a command could look like this (if the list is in a file):

echo 13 | cat listfile - | sort -n | sed '/^$/d' | cat - > listfile

(Replace the 13 by the number you want to insert, maybe the variable x, so the command sequence would start with echo $x |)

For explanation, I'll split it up:

echo 13 | outputs the number 13 to stdout, which is then piped into the next command
cat listfile - | first takes the contents of the listfile, afterwards   everything from stdin until an EOF, and then pipes the concatenated result to the next commands' stdin
sort -n | takes the piped list and sorts it taking the numeric nature of the input into consideration (as given by the -n switch, also see man sort)
sed '/^$/d' | removes any empty lines from the string, and forwards it again
cat - > listfile puts the whole thing back into listfile again. Yes, this works as opposed to things like sed 's/a/b/g somefile > somefile', which would empty the file.

If you want to split it up into multiple commands, you can make the thing a bite more legible by always operating on the file:

echo 13 >> listfile
sort -n listfile
sed -i '/^$/d' listfile

This can also come in handy if you need to add multiple entries. Simply append them all and then sort (which may be faster than searching for insertion positions each time).

Above command also works if you are operating on variables. For this, the content of the var has to be present as a string using newline separation so it can be sorted line-wise.

If the values are e.g. space separated, you could use the following command

list=$(echo $list 13 | sed -r 's/\s+/\n/g' | sort -n | sed '/^$/d')

Apart from the variable assignment, the only new command is the first sed, which replaces any contiguous sequence of whitespace characters (including newlines) by newlines to create line-separation. In the variable assignment, the list will be automatically converted back into space-separation.


Cursor putting marks on Screen in ubuntu 20.4 LTS

there is a problem with screen zoom. Either one should disable zoom from settings or if someone wnts to zoom the screen he/she shouldnt put the zoom level ==1x. Inshort review the zoom settings.


How stable is Juju 2.0 and can it be used for production of security-critical application?

No, I wouldn't do this just yet. There are still API and upgrade breaking changes going on.

When 2.0 hits RC1, then we will add the guarantee that you'll be able to upgrade environments. Until that time, upgrade isn't guaranteed to work as we are changing API calls and database schemas.


RegEx with \d doesn’t work in if-else statement with [[

\d and \w don't work in POSIX regular expressions, you could use [[:digit:]] though

#/bin/bash
release="1.9.2-alpha1"
echo "$release"
LANG=C # This needed only if script will be used in locales where digits not 0-9
if [[ "$release" =~ ^[[:digit:]]+\.[[:digit:]]+\.[[:digit:]]+-+ ]];then
echo "Pre"
else
echo "Release"
fi

I have tested this script, it output "Pre" for given $release

Checked out your regex builder, it works only with perl compatible and javascript regex, while you need posix, or posix extended.

By @dessert:

  [0-9] is the shorter alternative to [[:digit:]]. As the beginning
  of the string is to be matched, one should add ^, while .* at the
  end is superfluous: ^[0-9]+\.[0-9]+\.[0-9]+-+ – using a group this
  can be further shortened to: ^([0-9]+\.){2}[0-9]+-+


Listen to pulseaudio rtp stream using VLC


MATLAB install error: Failed to create folder

When matlab installation folder selection window appears erase all the text in the text box and put /home/Your_user_name/Matlab and continue . (the default path is /usr/local/Matlab/Rxxx, don't use it)

From https://community.linuxmint.com/tutorial/view/1493 .


Can't install Synaptic or Grace on Ubuntu 12.10

in terminal type this:

sudo add-apt-repository "deb http://archive.ubuntu.com/ubuntu quantal main"

and than type

sudo apt-get update

after this you should be able to install synaptic through software centre


Linux software is organized in packages, and apt is the software that manages those packages. A software package may depend on many other software packages in order to run. For example, if you install the package for Wine, apt will report that wine depends on several other packages, which in turn depend on other packages that do certain things for Wine, like fonts, filesystem utilities, filetype support, etc.

Organizing software this way has many advantages.

There is no need to install a piece of software twice.
It is incredibly easy to remove and install packages because it is all automated.
Removing software is always non-invasive.
Upgrading software is a breeze.
There is no need to keep track of a bunch of downloaded executable installer files.

In Windows, you would have one big folder for a program holding all the software binaries, icons, configuration files, and the whole blob for a specific program. In Linux, you have a dedicated folder for all the icons the system uses (/usr/share/icons), all the binaries (/bin), all the firmware files (/lib/firmware), and the rest. The package file for a piece of software keeps track of all of its files across the system. Things are a lot easier to find this way.

When you install a package, this is what happens: Say you invoke the command sudo apt-get install libreoffice:

The package lists on your computer (in /var/lib/apt/lists) are checked for a package named libreoffice. The lists provide information about all of the different installable packages, which are stored on http://archive.ubuntu.com/. The website is not meant to be browsed by users (see below), instead it's intended to be used by apt. The package's dependencies are examined (in libreoffice's case the list is extensive). If dependencies need to be installed, they are added to the list of packages to be installed, in the correct order.
The packages are all downloaded from http://archive.ubuntu.com/. If you have selected a different mirror to get more speed, they are downloaded from there.
The package files themselves are ar achives which in turn contain archives for program data, and information on where the data goes with more detailed information about the package. The packages are decompressed individually and then set up according to what is detailed in the package's control information in the archive. Any specific scripts are then run and configuration files are changed.
Meanwhile, apt keeps track of the status of the packages: whether they are installed, partially installed, or not installed.

If you want to know what is going on "behind the scenes", you can check the files that a package installs across the system on http://packages.ubuntu.com/. You can also download .deb package files from there, if you need to, but you wouldn't typically want to. You can also use apt to download and see the details of packages.

To download a package file and its dependencies: sudo apt-get download
<package>
To see the details of a package: sudo apt-cache showpkg <package>
To see what packages you have downloaded (this directory is normally
write-protected and not accessible by normal users): ls /var/cache/apt/archives
To clear the cache and save disk space: sudo apt-get clean

To conclude, in Linux, it is not necessary to know as the user where all the package's files are kept and what exactly is being done when you install one, unless you are doing advanced operations that explicitly require that knowledge. You have the powerful Software Center to see what programs you have installed and you can use that to install and remove them.


Ubuntu15.10 make a screenshot with keyboard shortcut no save option display？

I'm not sure I understand the question, but if you are looking for the screen-shot shortcut its just PrtSc on your keyboard. Just press the button and gnome-screen-shot will open and ask you where to store the screen-shot.

If you want more advanced screen-shot options open Software Center and search for "shutter".


what is the problem running osdlyrics in ubuntu 17.10?

I had a similar issue on ubuntu 18.04, the solution for me was to install the python dependencies mentioned here

https://aur.archlinux.org/packages/osdlyrics-git/

and instead of using pip to install them I just used apt-get

sudo apt-get install python-chardet python-dbus python-gobject python-pycurl


On Ubuntu 16.04 you need to install dconf-editor and change cursor-scale-factor

$ sudo apt-get install dconf-editor
$ dconf-editor

Then, set com > canonical > unity > interface > cursor-scale-factor to any number larger than 1. The maximum possible value is 3.


sudo chown -R $USER:USER /media/(rest of path)

or

sudo chown -R $USER /media/(rest of path)

The 1st will change user and group to your current user. The 2nd only set your user to your current user.