A timer to set up different alarms simultaneosly

multi-timer bash script

The multi-timer bash script works in Ubuntu versions 14.04, 16.04 and 18.04. It also works in Windows 10 with Ubuntu 16.04 Desktop installed.

Features

Retains configuration between uses.
Up to 19 timers run sequentially in a set.
Progress bar for each timer.
Set of timers can be run multiple times.
Progress bar for set.
Progress bar for all sets.
Optional prompt to start each timer and/or set.
Optional pop-up message when each timer and/or set ends.
Optional alarm when each timer and/or set ends.
Optional lock screen when each timer OR set OR all sets end.
Optional interface to Sysmonitor Indicator so Systray shows countdowns.
Optional close progress bar display when all sets of timers end.

Requires yad package sudo apt install yad

Notebook Configuration Tab

yad (Yet Another Dialog) has a feature that allows multi-timer fields to be divided between two separate panels accessed within one window via notebook tabs.

The Configuration Tab lets you:

define time units in Seconds/Minutes
define how many times to run set of timers.
link to sound file used for timer alarms
option to lock screen at end of each timer, set, or all sets
additional options as illustrated below

Notebook Timers Tab

The Timers Tab allows you to:

Define alias for each timer rather than Timer 1, Timer 2, etc.
Set the number of seconds or minutes each timer runs.

Progress Bar Display

As multi-timer counts down progress bars are used for:

each active timer (zero duration timers are not shown)
each set (if two or more active timers in set)
all sets (if two or more sets run)

Bash Script

Copy and paste the bash script below to filename multi-timer. I suggest the directory /home/<your_user_name>/bin/. Afterwards mark the script as executable using:

chmod a+x /home/<your_user_name>/bin/multi-timer

Changing number of Timers

At line number 78, 79 and 80 you will see this:

# No. of timers default is 17 for 768 line screen and TMR_DURATION_NDX is 30
TMR_DURATION_NDX=30 # Set to 28 for 800x600 screen, 32 for 1920x1080 screen
MAX_TIMERS=17       # Set to 15 for 800x600 screen, 19 for 1920x1080 screen

Although 19 timers are supported, they might only fit on a 1920x1080 screen. About 17 (the default setting) will fit on the average 1024x768 screen. If you have Super VGA with 800x600 resolution you might only get 13 to 15 timers.

You must change the values on lines 85 & 86 at the same time:

Bash field name    ----------- Values to assign ---------
TMR_DURATION_NDX   23  24  25  26  27  28  29  30  31  32
MAX_TIMERS         10  11  12  13  14  15  16  17  18  19

eg If you want a maximum of 12 timers, set TMR_DURATION_NDX=25 and MAX_TIMERS=12.

After changing the Index and Maximum save the multi-timer file. If you have already run the program once a configuration file may have been created and it will have to be deleted. Use this command to remove the old configuration file:

`rm ~/.multi-timer`

Note that ~/ is a short cut to your home directory, ie /home/your_user_name/.

Bash code for multi-timer

#!/bin/bash

# NAME: multi-timer
# DESC: Multiple timers countdown with alarm.
#       https://askubuntu.com/questions/1039357
#       /a-timer-to-set-up-different-alarms-simultaneosly

# DATE: May 31, 2018. Modified March 23, 2019.

# UPDT: 2018-06-07 Add new index for check box: "automatically close
#           progress bar display when all Sets finish". Remove '~/.multi-timer'
#           to delete configuration file before running update.

#       2018-06-19 Set fWindows flag to TRUE/FALSE instead of true/false.

#       2018-11-04 Early exit call Cleanup ()? For some reason sysmon-indicator
#           still displays: '~/.lock-screen-timer-remaining'???
#           Alarm only sounding for first timer but pop-up appears for all???
#           See changes to /etc/pulse/default.pa below:
#### Automatically suspend sinks/sources that become idle for too long
# Nov 4, 2018 - causes 3 to 5 second delay if last sound was 30 seconds ago.
# So you get sound delayed unpausing video or miss multi-timer alerts. Add #
# load-module module-suspend-on-idle
#           Although this fixes delay when switching between sound sources,
#           still change default alarm to sound file over 5 seconds long.

#       2018-12-05 HDD LED indicator flashing constantly while progress bars
#           are updated / program sleeps. Make LastWakeMicroSeconds dependant
#           on lost time log enabled only.

#       2019-03-23 Change default number of timers from 17 to 10 which suits
#           Windows 10 better and is more realistic number for most users.
#           Change grep arguments for "fWindows10" flag.
#           Put "Linux" or "Windows 10" as title prefix.
#           Set Windows 10 Sound file default to C:\Windows\media\Ring05.wav.
#           Error when notify-send command installed (minimal Windows 10).
#       Override "/mnt/c/Windows..." to "C:\Windows..." when invoked.

# NOTE: Following conventions are used:
#           Functions must be defined above point where they are called.
#           Yad style TRUE/FALSE instead of Bash true/false convention.
#           Variables beginning with- s is string
#                                   - i is integer
#                                   - f is TRUE/FALSE
#                                   - a is array
#                                   - cb is combobox

# Must have the yad package.
command -v yad >/dev/null 2>&1 || { echo >&2 \
        "yad package required but it is not installed.  Aborting."; \
        exit 99; }

# Must have notify-send from libnotify-bin package
command -v notify-send >/dev/null 2>&1 || { echo >&2 \
        "libnotify-bin package required but it is not installed.  Aborting."; \
        exit 99; }

# Running under WSL (Windows Subsystem for Linux)?
if grep -qE "(Microsoft|WSL)" /proc/version &> /dev/null ; then
    fWindows10=TRUE
    DefaultSound="C:\Windows\media\Ring05.wav"
    TitlePrefix="Windows 10"
else
    fWindows10=FALSE
    DefaultSound="/usr/share/sounds/freedesktop/stereo/alarm-clock-elapsed.oga"
    TitlePrefix="Linux"
fi

# On Skylake i7-6700HQ .467 seconds lost over 20 minutes incl writing to file.
if [[ "$1" == "-l" ]] || [[ "$1" == "--log-lost-time" ]] ; then
    fLog=TRUE
else
    fLog=FALSE
fi

KEY="12345"     # Key for tying Notebook pages (tabs) together
OIFS=$IFS;      # Save current IFS (Input File Separator)
IFS="|";        # Yad fields and Bash array indices separated by `|`
aMulti=()       # Main array for storing configuration
# Temporary files for Notebook output
res1=$(mktemp --tmpdir iface1.XXXXXXXX) # Notebook Configuraion Page (Tab 1)
res2=$(mktemp --tmpdir iface2.XXXXXXXX) # Notebook Timers Page (Tab 2)

Cleanup () {
    rm -f "$res1" "$res2"               # Remove temporary files
    IFS=$OIFS;                          # Retore Input File Separator
    if [[ -f ~/.lock-screen-timer-remaining ]]; then
        # Remove Sysmonitor Indicator interface file.
        rm -f ~/.lock-screen-timer-remaining
    fi
}

# Comboboxes, constants and Index offsets
cbTimeUnits="Seconds!Minutes"
cbLockScreen="Never!Each timer end!Each set end!All sets end"

TIME_UNIT_NDX=0
SET_COUNT_NDX=1
PROGRESS_INTERVAL_NDX=2
ALARM_FILENAME_NDX=3
LOCK_SCREEN_NDX=4
PROMPT_BEFORE_TIMER_NDX=5
END_TIMER_MESSAGE_NDX=6
END_TIMER_ALARM_NDX=7
PROMPT_BEFORE_SET_NDX=8
END_SET_MESSAGE_NDX=9
END_SET_ALARM_NDX=10
SYSMONITOR_INDICATOR_NDX=11
CLOSE_PROGRAM_AT_END_NDX=12
TMR_ALIAS_NDX=13
# No. of timers default is 17 for 768 line screen and TMR_DURATION_NDX is 30
TMR_DURATION_NDX=23 # Set to 28 for 800x600 screen, 32 for 1920x1080 screen
MAX_TIMERS=10       # Set to 15 for 800x600 screen, 19 for 1920x1080 screen

ReadConfiguration () {

    if [[ -s ~/.multi-timer ]]; then
        read -ra aMulti < ~/.multi-timer
        for (( i=0; i<MAX_TIMERS; i++ )); do
            aAlias[i]="${aMulti[ i+TMR_ALIAS_NDX ]}"
            aDuration[i]="${aMulti[ i+TMR_DURATION_NDX ]}"
        done
        # Set Combobox default with ^ prefix
        Str="${aMulti[TIME_UNIT_NDX]}"
        cbTimeUnits="${cbTimeUnits/$Str/\^$Str}"
        Str="${aMulti[LOCK_SCREEN_NDX]}"
        cbLockScreen="${cbLockScreen/$Str/\^$Str}"
    else
        # Create new file
        aMulti[TIME_UNIT_NDX]="Seconds"
        aMulti[SET_COUNT_NDX]=1
        aMulti[PROGRESS_INTERVAL_NDX]=1
        aMulti[ALARM_FILENAME_NDX]="$DefaultSound"
        aMulti[LOCK_SCREEN_NDX]="Never"
        aMulti[PROMPT_BEFORE_TIMER_NDX]="FALSE"
        aMulti[END_TIMER_MESSAGE_NDX]="FALSE"
        aMulti[END_TIMER_ALARM_NDX]="TRUE"
        aMulti[PROMPT_BEFORE_SET_NDX]="FALSE"
        aMulti[END_SET_MESSAGE_NDX]="FALSE"
        aMulti[END_SET_ALARM_NDX]="FALSE"
        aMulti[SYSMONITOR_INDICATOR_NDX]="FALSE"
        aMulti[CLOSE_PROGRAM_AT_END_NDX]="FALSE"
        aAlias=("Timer 1" "Timer 2" "Timer 3" "Timer 4" "Timer 5" \
                "Timer 6" "Timer 7" "Timer 8" "Timer 9" "Timer 10" \
                "Timer 11" "Timer 12" "Timer 13" "Timer 14" "Timer 15" \
                "Timer 16" "Timer 17" "Timer 18" "Timer 19")
        aDuration=(0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0)
    fi

} # ReadConfiguration

BuildTimerPage () {

    aTimerPage=()
    for ((i=0; i<MAX_TIMERS; i++)); do
        b1=$(( i + 1 ))
        aTimerPage+=("--field=Timer $b1 Alias:")
        aTimerPage+=("${aAlias[i]}")
    done
    for ((i=0; i<MAX_TIMERS; i++)); do
        aTimerPage+=("--field=Duration::NUM")
        aTimerPage+=("${aDuration[i]}")
    done
}

GetParameters () {

    # configuration notebook page
    yad --plug=$KEY --tabnum=1 --form \
    --field="Timer duration units::CB" "$cbTimeUnits" \
    --field="Number of times to run set (all timers)::NUM" \
            "${aMulti[SET_COUNT_NDX]}"!1..99!1!0 \
    --field="Progress Bar update every x seconds::NUM" \
            "${aMulti[PROGRESS_INTERVAL_NDX]}"!1..60!1!0 \
    --field="Alarm sound filename:FL" "${aMulti[ALARM_FILENAME_NDX]}" \
    --field="Lock screen::CB" "$cbLockScreen" \
    --field="Ask to begin each timer:CHK" \
            "${aMulti[PROMPT_BEFORE_TIMER_NDX]}" \
    --field="Pop-up message when each timer ends:CHK" \
            "${aMulti[END_TIMER_MESSAGE_NDX]}" \
    --field="Sound alarm when each timer ends:CHK" \
            "${aMulti[END_TIMER_ALARM_NDX]}" \
    --field="Ask to begin each set (all timers):CHK" \
            "${aMulti[PROMPT_BEFORE_SET_NDX]}" \
    --field="Pop-up message when each set ends:CHK" \
            "${aMulti[END_SET_MESSAGE_NDX]}" \
    --field="Sound alarm when each set ends:CHK" \
            "${aMulti[END_SET_ALARM_NDX]}" \
    --field="Interface to Sysmonitor Indicator:CHK" \
            "${aMulti[SYSMONITOR_INDICATOR_NDX]}" \
    --field="Auto close progress bar display when all sets end:CHK" \
            "${aMulti[CLOSE_PROGRAM_AT_END_NDX]}" > "$res1" &

    # timers notebook page
    BuildTimerPage
    yad --plug=$KEY --tabnum=2 --form --columns=2 \
        "${aTimerPage[@]}" > "$res2" &

    # run main dialog
    #  --image=gnome-calculator
    if yad --notebook --key=$KEY --tab="Configuration" --tab="Timers" \
        --image=/usr/share/icons/gnome/48x48/status/appointment-soon.png \
        --title="$TitlePrefix multi-timer setup" --auto-close \
        --width=400 --image-on-top --text="Multiple Timer settings"
    then

        # When LC_NUMERIC=it_IT-UTF8 30 seconds can be `30,000000` or
        # `30.000000` which breaks bash tests for `-gt 0`.
        # Search and replace ".000000" or ",000000" to null
        sed -i 's/[,.]000000//g' "$res1"
        sed -i 's/[,.]000000//g' "$res2"

        # Save configuration
        truncate -s -1 "$res1" # Remove new line at EOF
        cat "$res1" >  ~/.multi-timer
        truncate -s -2 "$res2" # Remove trailing "|" and new line at EOF
        cat "$res2" >> ~/.multi-timer
        # Get user changes into aAlias & aDuration
        ReadConfiguration
        return 0
    else
        return 1    # Cancel click or Escape press
    fi

}

fNewRun=FALSE
fNewTimer=FALSE
iSetSaveSec=0

InitTimers () {

    if [[ "${aMulti[TIME_UNIT_NDX]}" == "Seconds" ]]; then
        fUnitsInSeconds=TRUE
    else
        fUnitsInSeconds=FALSE
    fi

    iActiveTimersCount=0
    for ((i=0; i<MAX_TIMERS; i++)); do
        if [[ ${aDuration[i]} -gt 0 ]] ; then
            (( iActiveTimersCount++ ))
            iSetSaveSec=$(( iSetSaveSec + ${aDuration[i]} ))
        fi
    done

    # Progress Bars, 1 per timer + optional: set and/or set count
    iAllSetsSaveCount="${aMulti[SET_COUNT_NDX]}"
    iAllSetsRemainingCount=$iAllSetsSaveCount
    fSetProgressBar=FALSE # Summary progress bar when > 1 timer used
    iSetProgressBarNo=0
    fAllSetsProgressBar=FALSE  # Summary progress bar when > 1 run
    iAllSetsProgressBarNo=0
    if [[ $iActiveTimersCount -eq 0 ]]; then
        # If active timers count = 0, error message & clear run count
        yad --title "mutli-timer error" --center --text \
            "At least one non-zero timer required." --image=dialog-error \
            --on-top --borders=20 --button=gtk-close:0
        iAllSetsRemainingCount=0 # Set orderly exit via sibling function(s)
        iProgressBarCount=0
        fAbend=TRUE
    else
        # Active timers count > 0 so calculate times
        fNewTimer=TRUE
        fNewRun=TRUE
        [[ $fUnitsInSeconds == FALSE ]] && \
            iSetSaveSec=$(( iSetSaveSec * 60 ))
        iAllSetsSaveCountSec=$(( iSetSaveSec * iAllSetsRemainingCount ))
        iAllSetsElapsedSec=0
        iProgressBarCount=$iActiveTimersCount
        if [[ $iActiveTimersCount -gt 1 ]]; then
            (( iProgressBarCount++ )) # Extra progress bar for Set
            fSetProgressBar=TRUE
            iSetProgressBarNo=$iProgressBarCount
        fi
        if [[ $iAllSetsRemainingCount -gt 1 ]]; then
            (( iProgressBarCount++ )) # Extra progress bar for Set Count
            fAllSetsProgressBar=TRUE
            iAllSetsProgressBarNo=$iProgressBarCount
        fi
    fi

    # Friendly variable names instead of Array entries
    iProgressSleepSeconds="${aMulti[PROGRESS_INTERVAL_NDX]}"
    sSoundFilename="${aMulti[ALARM_FILENAME_NDX]}"
    if [[ $fWindows10 == TRUE ]] ; then
        mod="${sSoundFilename//\//\\}" # Replace Linux / with Windows \
    mod="${mod#*Windows}"          # Remove "/mnt/whatever/Windows"
        sSoundFilename="C:\\Windows""\\$mod"
    fi

    fPromptBeforeTimer="${aMulti[PROMPT_BEFORE_TIMER_NDX]}"
    fEndTimerMessage="${aMulti[END_TIMER_MESSAGE_NDX]}"
    fEndTimerAlarm="${aMulti[END_TIMER_ALARM_NDX]}"
    fPromptBeforeSetRun="${aMulti[PROMPT_BEFORE_SET_NDX]}"
    fEndSetMessage="${aMulti[END_SET_MESSAGE_NDX]}"
    fEndSetAlarm="${aMulti[END_SET_ALARM_NDX]}"
    fSysmonitorIndicator="${aMulti[SYSMONITOR_INDICATOR_NDX]}"
    fCloseProgramAtEnd="${aMulti[CLOSE_PROGRAM_AT_END_NDX]}"
} # InitTimers

# Optional lost time log file monitors program execution time for progress
# bars
[[ $fLog == TRUE ]] && echo "multi-timer lost time log"  > ~/multi-timer.log

PromptToStart () {

    # $1= Message key text
    # Dialog box to proceed with timer.
    yad --title "mutli-timer notification" --center --on-top \
        --fontname="Serif bold italic 28" \
        --text "Ready to start $1" \
        --image=/usr/share/icons/gnome/48x48/status/appointment-soon.png \
        --borders=20 --button=gtk-execute:0

    # Eliminates time waiting for user input
    [[ $fLog == TRUE ]] && LastWakeMicroSeconds=$(date +%s%N)
}

EndMessageAndAlarm () {

    # $1= fEndTimerMessage, $2= fEndTimerAlarm, $3= Message key text

    # Sound alarm when timer ends
    if [[ "$2" == TRUE ]]; then
        if [[ $fWindows10 == TRUE ]] ; then
            powershell.exe -c "(New-Object Media.SoundPlayer $sSoundFilename).PlaySync();"
        elif [[ ! -f "$sSoundFilename" ]]; then
            notify-send --urgency=critical "multi-timer" \
            --icon=/usr/share/icons/gnome/48x48/status/appointment-soon.png \
            "Sound file not found: $sSoundFilename"
        else
            paplay "$sSoundFilename" ;
        fi
    fi

    # Bubble message when timer ends
    if [[ "$1" == TRUE ]]; then
        notify-send --urgency=critical "multi-timer" \
            --icon=/usr/share/icons/gnome/48x48/status/appointment-soon.png \
            "$3 has ended."
        # Something bold to test. Set $3 has ended. into $phrase
        # /usr/bin/notify-send  --urgency=critical --icon=clock -t 4000 \
        # "Time Now" "$phrase" >/dev/null 2>&1

    fi
}

LockScreenCheck () {

    # $1=Run type being checked:
    # "Each timer end" / "Each set end" / "All sets end"
    [[ "$1" != "${aMulti[$LOCK_SCREEN_NDX]}" ]] && return 0

    # When locking screen override & prompt to start next timer / run
    [[ "$1" == "Each timer end" ]] && fPromptBeforeTimer=TRUE
    [[ "$1" == "Each set end"   ]] && fPromptBeforeSetRun=TRUE

    if [[ $fWindows10 == TRUE ]]; then
        # Call lock screen for Windows 10
        rundll32.exe user32.dll,LockWorkStation
    else
        # Call screen saver lock for Ubuntu versions >= 14.04.
        dbus-send --type=method_call --dest=org.gnome.ScreenSaver /org/gnome/ScreenSaver org.gnome.ScreenSaver.Lock
    fi
}

iCurrTimerNo=0
iCurrTimerNdx=0
TotalLostTime=0

PrepareNewSet () {

    # Was a set just completed?
    if [[ $iAllSetsRemainingCount -ne $iAllSetsSaveCount ]]; then
        # Display mssage and/or sound alarm for set end
        EndMessageAndAlarm $fEndSetMessage $fEndSetAlarm \
                           "$sSetProgressText"
        # Check to lock screen
        LockScreenCheck "Each set end"
    fi

    if [[ $iAllSetsRemainingCount -eq 0 ]]; then
        # We are done. Force exit from all while loops.
        fNewRun=FALSE
        fNewTimer=FALSE
    else
        # Decrement remaining run count and start at first timer.
        (( iAllSetsRemainingCount-- ))
        iSetElapsedSec=0
        fNewTimer=TRUE
        iCurrTimerNo=0
        iCurrTimerNdx=0
        iNextTimerNdx=0
        iCurrSetNo=$(( iAllSetsSaveCount - iAllSetsRemainingCount ))
        sSetProgressText="Set $iCurrSetNo of $iAllSetsSaveCount"
        [[ $fPromptBeforeSetRun == TRUE ]] && \
            PromptToStart "$sSetProgressText"
    fi
}

PrepareNewTimer () {

    iCurrTimerElapsedSec=0
    if [[ $iCurrTimerNo -eq $iActiveTimersCount ]]; then
        # Last timer done. Force exit from inner while loop.
        fNewTimer=FALSE
        return 0
    fi

    for ((i=iNextTimerNdx; i<MAX_TIMERS; i++ )); do
        if [[ ${aDuration[i]} -gt 0 ]]; then
            iCurrTimerNdx=$i
            (( iCurrTimerNo++ ))    # Increment progress bar number
            iNextTimerNdx=$(( iCurrTimerNdx + 1 ))
            iCurrTimerSaveSec=${aDuration[i]}
            [[ $fUnitsInSeconds == FALSE ]] && \
                            iCurrTimerSaveSec=$(( iCurrTimerSaveSec * 60 ))
            iCurrTimerRemainingSec=$iCurrTimerSaveSec
            break
        fi
    done
}

# Next function could be embedded within InitTimers to save space
# and code line count but this provides better readability IMO.
SetupYadProgressBars () {

    aYadProgressBars=("yad" "--multi-progress" "--center")
    aYadProgressBars+=("--title=multi-timer progress")
    [[ $fCloseProgramAtEnd == TRUE ]] && aYadProgressBars+=("--auto-close")
    aYadProgressBars+=("--auto-kill" "--watch-bar$iProgressBarCount")

    for ((i=0; i<MAX_TIMERS; i++)); do
        if [[ ${aDuration[i]} -gt 0 ]] ; then
            b1=$(( i + 1 ))
            aYadProgressBars+=("--bar=Timer $b1 - ${aAlias[i]}:NORM")
        fi
    done

    if [[ $fSetProgressBar == TRUE ]]; then
        aYadProgressBars+=("--bar=Set:NORM")
    fi
    if [[ $fAllSetsProgressBar == TRUE ]]; then
        aYadProgressBars+=("--bar=All Sets:NORM")
    fi
}

DisplayProgressBar () {

    # Parameters
    # $1=Elapsed Time, $2=Total Time, $3=Bar Number,
    # $4=TRUE/FALSE if eligible to update Sysmonitor Indicator
    # $5=Sysmonitor Indicator text for interface file or null
    # $6=Progress Text Prefix, ie "Set 2 of 4: " or null
    iPercentage=$(( $1 * 100 / $2 ))
    echo "$3:$iPercentage"

    RemainingSec=$(( $2 - $1 ))
    h=$((RemainingSec/3600))
    m=$(((RemainingSec%3600)/60))
    s=$((RemainingSec%60))

    TimeRemaining=""
    [[ $h -gt 0 ]] && TimeRemaining=$TimeRemaining" $h Hours"
    [[ $m -gt 0 ]] && TimeRemaining=$TimeRemaining" $m Minutes"
    [[ $s -gt 0 ]] && TimeRemaining=$TimeRemaining" $s Seconds"
    if [[ $TimeRemaining == "" ]]; then
        echo "$3:#$6Finished."
    else
        echo "$3:#$6$TimeRemaining remaining."
    fi

    if [[ $fSysmonitorIndicator == TRUE ]] && [[ $4 == TRUE ]]; then
        echo "$5: $TimeRemaining" > ~/.lock-screen-timer-remaining
    fi
}

ProcessCurrTimer () {

    sTimerAlias="${aAlias[iCurrTimerNdx]}"

    # Dialog box to proceed with timer.
    [[ $fPromptBeforeTimer == TRUE ]] && PromptToStart "$sTimerAlias"

    iLastSleepSec=0
    [[ $fLog == TRUE ]] && echo Start timer: "${aAlias[iCurrTimerNdx]}" \
        >> ~/multi-timer.log

    while [[ $iCurrTimerElapsedSec -lt $iCurrTimerSaveSec ]]; do

        iCurrTimerElapsedSec=$(( iCurrTimerElapsedSec + iLastSleepSec))
        iSetElapsedSec=$(( iSetElapsedSec + iLastSleepSec))
        iAllSetsElapsedSec=$(( iAllSetsElapsedSec + iLastSleepSec))

        DisplayProgressBar $iCurrTimerElapsedSec $iCurrTimerSaveSec \
            $iCurrTimerNo TRUE "${aAlias[iCurrTimerNdx]}" "" ""
        if [[ $fSetProgressBar == TRUE ]] ; then
            DisplayProgressBar $iSetElapsedSec $iSetSaveSec \
                           $iSetProgressBarNo FALSE "" "$sSetProgressText: "
        fi
        [[ $fAllSetsProgressBar == TRUE ]] && \
            DisplayProgressBar $iAllSetsElapsedSec $iAllSetsSaveCountSec \
                           $iAllSetsProgressBarNo FALSE "" ""

        # We sleep lesser of iProgressSleepSeconds or iCurrTimerRemainingSec
        iCurrTimerRemainingSec=$(( iCurrTimerRemainingSec - iLastSleepSec))
        if [[ $iProgressSleepSeconds -gt $iCurrTimerRemainingSec ]]; then
            iLastSleepSec=$iCurrTimerRemainingSec
        else
            iLastSleepSec=$iProgressSleepSeconds
        fi

        if [[ $fLog == TRUE ]] ; then
            tt=$((($(date +%s%N) - LastWakeMicroSeconds)/1000000))
            echo "Last lost time: $tt milliseconds" >> ~/multi-timer.log
            TotalLostTime=$(( TotalLostTime + tt ))
            echo "Total Lost: $TotalLostTime milliseconds" ~/multi-timer.log
        fi
        sleep $iLastSleepSec
        [[ $fLog == TRUE ]] && LastWakeMicroSeconds=$(date +%s%N)

    done

    # Currently removing Sysmonitor Indicator after current timer. Need to
    # modify to do it based on choice box for "Lock Screen".
    if [[ -f ~/.lock-screen-timer-remaining ]]; then
        # Remove Sysmonitor Indicator interface file.
        rm -f ~/.lock-screen-timer-remaining
    fi

    # Check for and display mssage and/or sound alarm
    EndMessageAndAlarm $fEndTimerMessage $fEndTimerAlarm \
                       "Timer: $sTimerAlias"

    # cbLockScreen="Never!Each timer end!Each set end!All sets end"
    LockScreenCheck "Each timer end"
}

ZeroIndividualTimerProgressBars () {

    for ((i=1; i<=iActiveTimersCount; i++)); do
        echo "$i:0"
        echo "$i:#"
    done
}

###################################
#            MAINLINE             #
###################################

ReadConfiguration

if GetParameters ; then :
else
    # Escape or Cancel from yad notebook
    Cleanup
    exit 1
fi

InitTimers
if [[ $fAbend == TRUE ]]; then
    Cleanup
    exit 1
fi

SetupYadProgressBars
PrepareNewSet
[[ $fLog == TRUE ]] && LastWakeMicroSeconds=$(date +%s%N)

while [[ $fNewRun == TRUE ]]; do

    PrepareNewTimer
    while [[ $fNewTimer == TRUE ]]; do
        ProcessCurrTimer
        PrepareNewTimer
    done
    PrepareNewSet
    [[ $fNewRun == TRUE ]] && ZeroIndividualTimerProgressBars
    [[ $fLog == TRUE ]] && echo "Set Lost Time: $TotalLostTime milliseconds" \
        >> ~/multi-timer.log  # For some reason value is zero?

done | "${aYadProgressBars[@]}"

LockScreenCheck "All sets end"

# TO-DO why is $TotalLostTime zero below?
[[ $fLog == TRUE ]] && echo "All sets lost time: $TotalLostTime milliseconds" \
    >> ~/multi-timer.log

Cleanup

exit 0

Sysmonitor Indicator Interface

You can have the System Tray / Application Indicator Area update with the time remaining along with a "spinning text pizza" as illustrated in the GIF in above the bash listing.

To setup Sysmonitor Indicator see this Q&A: Can BASH display in systray as application indicator?


Is there still any modern non compositing desktop?

howtogeek has this to say about it:

Use a Non-Composited Desktop
If you do want to play 3D games in windowed mode and get maximum performance, you’ll need a non-composited desktop.
If you’re using Ubuntu 12.04, you can select Unity 2D on the login screen. Ubuntu 12.10 users will have to use a different desktop environment, as Unity 2D is no longer available.
Unity and GNOME Shell don’t allow you to disable compositing, although many other desktops do. You may want to try Xfce, KDE, or another desktop environment – just ensure you disable compositing in the desktop you choose. (Perform a Google search to learn how to disable compositing on your desktop of choice.) You’ll lose the fancy graphical effects, but windowed 3D rendering will speed up.

It mentions 12.10 but you can read this as "12.10 and newer".
The link has several desktops listed but I would start with XFCE if I was you. Mind though: compositing will be enabled on first install and you need to turn it off yourself. Regarding the 2 mentioned in the article, xfce and kde:

webupd8 on XFCE and disabling composite.
KDE.org forums on KDE and disabling composite.


hdmi no signal, except with hdd/ssd unplugged and booting on live distribution

"No matter what I do or plug, the motherboard buzzer displays one long and two short beeps."
You seem to be describing a hardware fault code, which is unrelated to Ubuntu. Contact your motherboard manufacturer to learn the meaning of the code.
Return your new equipment to the vendor for repair or replacement.
Ubuntu is not designed to run on broken or defective hardware.


In Ubuntu 18.04 (GNOME desktop), a .deskotp application launcher pointing to a script doesn't run said script

Change your

Exec=/home/paul/pgadmin4/pgadmin4.sh

To

Exec=bash /home/paul/pgadmin4/pgadmin4.sh


I installed a 64-bit OS in a 32-bit processor

If you installed a 64-bit OS your CPU is necessarily 64-bit capable. In a 32-bit only processor the 64-bit installer not even starts.

In lscpu output CPU op-mode(s):32-bit, 64-bit means your CPU is both 32-bit and 64-bit capable. Architecture: x86_64 is the current kernel architecture (64-bit).

You can also check 64-bit support running:

grep " lm " /proc/cpuinfo

If it outputs nothing you have a 32-bit CPU. If it outputs something like flags : blah blah lm blah blah blah your CPU supports Long Mode (AKA 64-bit).


The easiest way to make Bash scripts that are available to all users of your computer is to place them in /usr/local/bin. This requires you to have admin privileges though.

Create you script:

Open your favourite text editor and write all the commands you wish the script to run, one command per line.

You can add comments to Bash scripts by beginning a line with #.

When you're done, add this exact line below as first line at the top of your script. It's called a "shebang" and tells the shell with which interpreter to execute your script.

#!/bin/bash

Here's a simple example of a full script, running the two commands you mentioned in your question:

#!/bin/bash

# Compile 'file':
gcc file -o file
# Compile 'file1':
gcc file1 -o file1

Move your script to the correct location:

The location where you should place own scripts for all users is /usr/local/bin.

As this directory is owned by user root, you must be an admin and use sudo to move files there.

I assume you created your script in your home directory, ~/my_script.sh. Simply open a terminal and type the command below, replacing SCRIPTNAME with the name you want to give it. This name will be the command you have to type to run it. The .sh file extension is not necessary.

sudo mv ~/myscript.sh /usr/local/bin/SCRIPTNAME

Set the correct owner and permissions:

The script should be owned by and writable for root, but readable and executable for everyone. The two commands below ensure this:

sudo chown root: /usr/local/bin/SCRIPTNAME
sudo chmod 755 /usr/local/bin/SCRIPTNAME

Run your script and enjoy:

Now you can simply type SCRIPTNAME (or however you called it) to your terminal and the script will get executed.


How to install NetSurf web browser in ubuntu 14.04

Go and download the source (preferably the top, most recent link on that page), and compile it yourself by extracting the archive to ~/netsurf then:

cd ~/netsurf
sudo make
sudo make install

or simply , download  *.deb file(binary file) from  official website of NetSurf

and install it, by using software centre or by Gdebi package installer or
 cd into directory which consists downloaded binary file and then, install it using below command

sudo dpkg -i package_name.deb

here, package_name is downloaded package name.

if you encounter any problems dependency problems  ,
run,

sudo apt-get update && sudo apt-get -f install

for me,
the above command solved problem occurred during installation process.


The bare bones minimal would be

sudo apt-get install xfce4

If you do not install a log in manager (slim, gdm, light-gdm, etc) you will not have a graphical login screen, and in that case you can either startx or xfce4-session

Depending on how much or little you wish to configure, you may want to go with lightdm ;)

If you need assistance configuring your xfce4 session (from the command line or with a log in manager) post back.

You will almost certainly wish to install additional fonts and additional xfce packages. Many of the extras are "plugins" , ie "xfce4-foo-plugin"

Either search for the packages, or if you prefer, install the "goodies" package

http://packages.ubuntu.com/precise/xfce4-goodies

Additional packages to consider (IMO) might be firefox, synaptic, squeeze, xfburn

Text editors , personally I prefer gedit as it has a number of features, but leafpad or mousepad are more traditional / lightweight (but scant features).

The following would give you a nice (IMO), minimal setup, adapt the packages as you wish.

sudo apt-get install xfce4 xfce4-goodies xfce4-mixer gedit squeeze synaptic xfburn lightdm audacious audacious-plugins

Other plugins listed here

http://packages.ubuntu.com/cgi-bin/search_packages.pl?keywords=xfce&searchon=name&subword=1&version=all&release=all

Add in a few fonts and multimedia as required and you would be good to go.


Chromium opens PDFs with Gimp, rather than the system default

Ok, after digging through a whole heap of stuff, I found that Chromium uses xdg-open to open files on Ubuntu.
The solution for me was to reconfigure xdg-open using the xdg-mime command as follows:
First, you need to know that xdg-mime works using .desktop files, for some reason. This is how it works out what programme it should use to open a file when Chrome calls it with xdg-open filename.pdf.
I use i3wm, a desktopless environment. In my case, the .desktop files I found were stored in ~/.local/share/applications/. If you take a look in here, you will probably see a load of different ones for various programmes you've installed.
(Note: if you use normal Ubuntu, it may be the case that xdg-mime simply uses the desktop files in ~/Desktop. You may need to adapt these instructions, so if they don't work, or there's nothing in ~/.local/share/applications/, just do everything the same but replacing ~/.local/share/applications/ with ~/Desktop).
Anyway, if you run the command
xdg-mime query default application/pdf

you'll be told something like (in my case):
wine-extension-pdf.desktop

This is a desktop file that was installed by wine at some point. I don't know why xdg-mime thinks it's the right one to use, but somehow it's decided to use it as the default to open pdf files. Why this also leads to Gimp being used, I also have no clue.
So, cd ~/.local/share/applications/ and confirm that this is the location of this wine-extension-pdf.desktop file (or whatever it is on your computer). Then, you need to create a new .desktop file. Call it something like pdf-evince.desktop, and give it the contents:
[Desktop Entry]
Type=Application
Name=evince
MimeType=application/pdf;
Exec=evince %f

Feel free to replace evince with your favourite pdf viewer.
You now need to register this new desktop link to be the default with xdg-mime, so run:
xdg-mime default pdf-evince.desktop application/pdf

Now go back to Chromium and try to open a downloaded pdf. It should open in your chosen pdf viewer!


Opening .doc, .docx with Sylpheed on Lubuntu

Open gedit
Copy and paste the following text into gedit:

[Desktop Entry]
Encoding=UTF-8
Name=Sylpheed Docs
Comment=Edit Files with Sylpheed
Exec=sylpheed %f
Type=Application
StartupNotify=true
NoDisplay=true
Icon=[sylpheed_icon_here].png

Save the file as sylpheed.desktop in the folder

      /home/[username]/.local/share/applications

Replacing [username] with your username.
Now left click on a .doc/.docx file and select Proporties -> Open With and select the app called Sylpheed Doc.
Whenever you open a .doc/.docx file, it will open with Sylpheed


How to give file permissions to an external hard drive?

To find the mounted folder of your drive, go into the file manager, select the drive on the left side panel and once you are inside the folder of your drive, press Ctrl + L and copy the path of the mounted directory.

Now open up a terminal (Windows-Key + T) and enter sudo chown [username]:[username] -R [directory]. An example would be:

sudo chown cubedev:cubedev -R /media/cubedev/ebf6d6c1-a9f9-4012-80d3-abcd26c2192c


How do I disable the blinking cursor in gnome-terminal?

You can disable the blinking also from the command line (gconf-editor is not installed by default):

 gconftool-2 --set /apps/gnome-terminal/profiles/Default/cursor_blink_mode --type string off

For newer versions of gnome-terminal, the command has changed:

gsettings set org.gnome.Terminal.Legacy.Profile:/org/gnome/terminal/legacy/profiles:/:$(gsettings get org.gnome.Terminal.ProfilesList default|tr -d \')/ cursor-blink-mode off


If someone ever has this issue, I solved it by linking to libdrm in my application.


Ubuntu 21.04 nothing happens when message: "Press Ctrl-C to cancel all filesystems checks"

It was errors in EFI (FAT-12/16/32) without repair...
Solution:
backup /etc/fstab e /etc/mtab
using Disks go to "Edit
Partition" change EFI to W95 FAT32 (LBA), mount and copy folder EFI to safe place
using Disks format EFI with FAT, copy folder EFI back to EFI partition
change FAT back to EFI (Edit
Partition)
do not forget to also restore UUID of EFI partition
in terminal:
mkdosfs -i 12345678 /dev/sda?
change 12345678 with original UUID in /etc/fstab or copy the number from Disks...
restore /etc/fstab e /etc/mtab
remove fsck.mode=skip from /etc/default/grub
sudo update-grub
reboot...


I have g551vw and use this for install ubuntu 16.04.3 LTS,

the problem was with nouveau Graphics Drivers, so I disabled it in the booting process by adding the code below to the end of Linux kernel flags in grub :

nouveau.modeset=0

When the GRUB boot menu appears: Highlight the Ubuntu menu entry and press the E key.
Add the nouveau.modeset=0 the parameter to the end of the Linux line ... Then press F10 to boot.

Link


How to find the folder/file into which nautilus writes data while wiping free space

Use the Disk Usage Analyzer and make sure to run it as root. Otherwise it will show errors and will leave you pondering as to why its not working. The culprit folder tmp was actually showing only 4.47KB when i checked its size so i had been mislead the first time i checked. I simply deleted that folder and got back the free space which i had lost earlier thanks to Disk Usage Analyzer which i had run as root.


E: Could not open file /var/lib/dpkg/status - open (2: No such file or directory)

Open the terminal,Ctrl + Alt + T,

$ sudo cp /var/backups/dpkg.status.0 /var/lib/dpkg/status
$ sudo apt-get update

Incase you get this error E: Lists directory /var/lib/apt/lists/partial is missing.

$ sudo mkdir /var/lib/apt/lists/partial


How to bridge additional IP of host over KVM?

https://askubuntu.com/a/638269/498411 - This helped!

I read that before asking this question but the problem was that I didn't completely reboot my server to setup my new interfaces.

Now it works!


Quickly: how do I return entered data into parent window?

Depending on your code, you could do something like this:

url = None
dialog = UrlDialog()
response = dialog.run()
if response == Gtk.ResponseType.OK:
    url = dialog.get_url()
dialog.destroy()

Then just implement a get_url() method or url property in your dialog class:

class UrlDialog(Gtk.Dialog):
    # Init etc...

    def get_url(self):
        return self.urlentry.get_text()


Ubuntu 18.04 LTS - Dual Boot gives problem on restart/power off of Ubuntu

I am not an expert. The thing I would try is to wipe the Ubuntu partitions and try a new clean installation from a file with checked checksums.


How do I set boot parameters in the installer?

At the boot menu, hit the F6 key and add that option at the end of the line before the "--".

See https://help.ubuntu.com/community/BootOptions#Changing_the_CD.27s_Default_Boot_Options


Unable to open Trash folder in Ubuntu 14.04

You need to create four separate directories (although I'm not sure this approach will actually work for you):

mkdir ~/.local/share/Trash
mkdir ~/.local/share/Trash/expunged
mkdir ~/.local/share/Trash/files
mkdir ~/.local/share/Trash/info

Let me know your progress on this and I'll update the answer as needed.


You can first try to just copy the default .profile from the original copy found in /etc/skel/:

First, it is recommended to make a backup of your profile first just in case (Thank you wjandrea):

/bin/cp ~/.profile{,.bak}

Then you can copy the default from the /etc/skel

/bin/cp /etc/skel/.profile /home/<username>/

If for some reason that does not work, you can follow the next part to replace your .profile from its original contents:

Boot your system to Recovery Mode first so that you have root capabilities to your system.

A .profile file is stored in the /etc/skel/ directory that you can copy to your home folder.

cp /etc/skel/.profile /home/<username>/

then set the permissions and ownership on the file so it matches your username:

chmod 600 /home/<username>/.profile
chown <username>:<username> /home/<username>/.profile

replacing <username> with your username that you created.

Hope this helps!


Ubuntu is Ubuntu.  The server and desktop editions run on the same base and pull from the same repositories, they're just pre-configured differently out of the box.  Since they point at the same repositories, it would be absolutely fine to do a sudo apt install ubuntu-desktop on a server system in order to get a GUI up and running.

GUIs do use system resources, but not much, especially when the DE is idling, and especially on a system with hundreds of GBs of RAM and a dual socket motherboard.  If installing a GUI on your server would be beneficial and help your team be productive, then you won't hurt a thing by doing so.  I personally don't like running GUIs on servers because they do use some RAM even when idling, but to each their own.  In my synaptic I see 4 different options for GUIs that you can install without getting exotic and adding additional software sources:

ubuntu-desktop (Installs the default Ubuntu and Gnome Shell experience, which is what you get if you download regular desktop Ubuntu)
kubuntu-desktop (Installs the default Ubuntu and KDE experience, more Windows-esque)
lubuntu-desktop (Installs the default Ubuntu LXDE experience, LXDE is billed as being lightweight)
xubuntu-desktop (Installs the default Ubuntu XFCE experience, XFCE is billed as being lightweight)

So to install one of these just run sudo apt install packagename

Just be aware that those packages are what are known as "meta" packages, in that they don't contain anything themselves, they just point to a whole list of other packages that set up a predefined condition, such as a default Kubuntu desktop environment with all of the normal applications that would come with that.  What that means is that when you install one of those, you might see it download a LOT of additional packages, and it may actually take a few minutes to set up.  You may also see it brand your "server" as Kubuntu, Lubuntu, etc.  Don't be alarmed, it's just a logo, :-)


That looks like a c-shell script. Use

sudo apt-get install csh

and then try running the script in the c-shell. You can open the c-shell by running csh from the bash shell.


How to add launcher icon for python script?

Due to the fact that your question is nicely documented, we can find the problem :)

In your application, you set:

root = tk.Tk(className='MyTkApp')

Now if you open a terminal, type:

$ xprop WM_CLASS

and subsequently click on the window of your application, it shows:

WM_CLASS(STRING) = "myTkApp", "Mytkapp"

This is just not the same as the window class you set; the capitals are different. The only conclusion is that for some reason, the window class (capital-format) you set is not accepted by the window manager.

When I changed your launcher to match myTkApp:

StartupWMClass=myTkApp

it works fine (for convenience reason, I set the firefox icon, since I don't have your icon):

[Desktop Entry]
Type=Application
Terminal=false
Name=My Tk Application
Exec=/home/jacob/Bureaublad/testapp.py
Icon=firefox
StartupWMClass=myTkApp

The result:


How to get superuser and install programs

My shot in the dark is based on this sentence: So, I've tried using sudo to run everything but it eventually crashes and errors at some point.

If you really do run everything by sudo probably the ownership to some files and folder in your user's home directory is changed to root:root, that causes a lot of errors. To check this, execute the following command and read the third and the fourth column (press q to exit):

ls -laR ~ | less

To recover from this situation execute:

sudo chown -R $USER:USER $HOME

This command will change recursively the ownership of /home/<user> to your user and :group.

The command sudo allows a permitted user to execute a command as the superuser (root). So you should be really careful when you using this command. The rule number one [read here]: don't use sudo with any graphical applications. It probably will cause the situation described above. If you have done this, maybe your downloaded files are located in /root/Downloads.

By the login option sudo -i you will be able to become root via your own credentials - username and password - if you are a permitted user. But to become root by the command su (switch user as I call it :) the root's account must be enabled, that is not recommended.

To install software packages on first place (as @Piloti suggested) use Ubuntu Software Center, find the application and click on the Install button. It will ask you for your password and if you are a permitted user, able to execute commands as root, the package will be installed.

If you already have downloaded any .deb package you could install it by double click on it and open with Ubuntu Software Center. You could install a .deb package also via the command line by the command dpkg -i. You should execute this command as root:

sudo dpkg -i <package name>.deb

You could install software packages via the command line directly from Ubuntu repositories by the command apt, that should be executed as root too. For example if you want to install Chromium browser execute the following command:

$ sudo apt install chromium-browser
[sudo] password for <user-name>: type your user's password here


How do I install the eID software on Ubuntu 20.04?

To install eID you need to open terminal and execute the following commands:
cd ~/Downloads
wget https://eid.belgium.be/sites/default/files/software/eid-archive_2020.4_all.deb
sudo apt-get install ./eid-archive_2020.4_all.deb
sudo apt-get update
sudo apt-get install eid-mw eid-viewer


How to repair/unlock gsettings (or dconf-editor)?

You can find your user dconf database in ~/.config/dconf, system level values are stored on /etc/dconf. The database are a combination of a fast-read binary file and text files inside a dir with the same name as the database but ended in .d:

I mean default system level values are stored both in /etc/dconf/ibus (a binary file) and /etc/dconf/ibus.d (a directory filled with text files)

You should first check if the problem is in the user or system level files and then delete (or restore) the problematic files.

You should find a backup of your user file (not the system level one) in ~/.config/dconf/, it's named user.XXXXXX where X can be any letter.

You can read the dconf system administrator guide here for more info.


I just set this up for my Dell laptop.  I installed Ubuntu 14.04 LTS (not live) on a USB flash drive. When I boot my laptop, it boots to Windows 10 by default.  Then, when I plug in the U-14 flash drive, I press F12  for the boot menu and choose Ubuntu.

In the computer BIOS, I turned OFF secure boot. I set Boot Options to Ubuntu, Windows Boot Manager, none and none.

Then I plugged in the Live and target USBs and booted to the Live USB. I used Gparted to partition a 2GB swap partition at the end of the target drive and formated the rest of the drive as EXT4, /.  After applying the changes, I changed the flag of the main partition to boot.

When I chose the partitions to install I chose to install U14 to the / partition.  I also changed the Boot option to SDB (not a partition.)

When I was done, I booted to the BIOS and turned ON the security boot.

When I boot, I press the  F12 key and get a choice to boot to Windows or Ubuntu.  If I remove the USB, it default boots to Windows.

I can also change the BIOS boot order to Ubuntu and then Windows.  Once set, I can boot to Ubuntu as long as the flash drive is plugged in before I turn on the computer.  But if I boot without it, I will have to use the boot menu to boot to Ubuntu until I change the BIOS default order again.

Ubuntu always boots through the Grub menu.   Windows does not use the Grub menu.

I hope this helps.


By default, the text editor (Gedit) does not autosave documents unless you manually saved them at least once beforehand. So if you didn't save your file, it's lost, unfortunately.

If you did save your file, the newer autosaved copy is in the same place as where you saved the file, but with "~" appended. This is a hidden file, so enable "Show hidden files" in the file manager (Ctrl + H), or use ls -a in the terminal to see it.


Can't access some websites,Always asks for recaptcha

Make sure you don't have any malware infected devices (including your Ubuntu system) on your local network.

Excessive Captchas are normally triggered by suspicious behaviour (i.e. mass requests) from your specific IP. Home routers normally use NAT to map your local network addresses to the one single public IP you get assigned by your ISP (Internet Service Provider). Therefore any device in your local network can make your whole network suspicious and trigger Captchas.

Sometimes this happens on another level again, as ISPs may use e.g. Dual-Stack lite to give each customer their own IPv6 address, but only a shared IPv4 address that is used by dozens or hundreds of customers at the same time. If this is the case for you, any random person with the same ISP as you could have made suspicious requests and trigger a ban or Captchas on your shared IPv4 address.

In that case, your home router might possibly offer a button to reconnect to the ISP network and obtain a new IP. Otherwise you just have to wait until the IP lease runs out in a few days, or contact your ISP about the matter.


Can I write data safely to a RAID-1 ARRAY while it is resyncing?

You can safely write to any degraded RAID array and not lose any data, that's a standard RAID feature
If a disk fails during sync, well it matters which disk that failed. If it was the resync target, who cares, it'll just resync from the master again. If it was the master then the RAID 1 has failed however that member still has the most up to date copy of the data. So if it's a transient error your data is probably fine, the system reboots and resync attempts to continue, if it's not then you've exceeded the protections provided by RAID 1 and have now lost data
No RAID is a substitute for regular backups aka duplicity or plain old rsync.


To undo these configuration changes you should simply remove the line with smtp_header_checks from you /etc/postfix/main.cf file and reload postfix service (service postfix reload).


Unable to access files created in Ubuntu

You could try to take owner of that file as you supposed your account being admin.

Open terminal CtrlAltT and launch this command:

sudo chown <your_username> PATHTO/thefile

PATHTO is the path to your file, for example /home/username/.


How to install a new graphic card without Xserver

This question was solved by the OP:

  Apparently a duplicate of: askubuntu.com/questions/61895/…

  The answer there solved my problem sudo apt-get purge nvidia* sudo rm
  /etc/X11/xorg.conf


I have the same configuration with the same setup as you have.I have pfSense firewall configured.I have webserver using ISPconfig , I too tried long with a NAT configuration.Then I failed, because in the NAT incoming protocol you cannot set any protocol as like in normal rules (In Pfsense).

The source protocol should be all (not supported in pfSense NAT Rule).

So, Let me give you suggestion how I did in my environment.Give direct public IP to the webs server.Create a VPN Server in the pfSense and created a user for it.Configure the VPN in the webserver and connected it to your local network.Then configure auto VPN connection if the server restarts.

I strongly recommend you this method.

If you have any queries please get back to me.


Please check in Settings Manager → Session and Startup → Application Autostart tab that you do not have an entry for the applications you find starting.


EDIT on extra info in the question:

Pbuild natively does what you want - just provide it with proper dsc file. Have a look at some real example with version in the dependences like nmap

apt-get source nmap; cat nmap_*.dsc

and look at the Build-Depends clause:

...
Build-Depends: debhelper (>= 9), libgtk2.0-dev, dh-autoreconf, flex, bison, libssl-dev, libpcap0.8-dev, libpcre3-dev, binutils-dev, liblinear-dev, python (>= 2.3.5-7), python-all-dev, liblua5.2-dev
...

In your case you need smth like

Build-Depends: libfoo (=1.2.1), flex, bison, ...

Original post:

So, let us summarise the comments....

What you need are two clauses from the rule file debian/control:

Build-Depends - dependencies of other packages for the source package build
Depends -  dependencies of other packages for installation package

I strongly urge you to read the whole Ubuntu Packaging Guide .Your question is addressed at 2.2. The control file . Read also the same information written by Debian team at Debian New Maintainers' Guide, more precisely Chapter 5 - Control files and their fields. The spent time with the manuals will pay off in saving you a lot of troubles in future if you're going to maintain deb packages in your company (or why not in Debian or Ubuntu one day :) ).


Does unattended-upgrades also include apt-get autoremove?

Whether or not unattended-upgrades will perform the cleanup (auto remove) is controlled by the Unattended-Upgrade::Remove-Unused-Dependencies setting in /etc/apt/apt.conf.d/50unattended-upgrades. Set it as follows to enable the cleanup -- and you should be able to remove the explicit autoremove cron-job:
Unattended-Upgrade::Remove-Unused-Dependencies  "true";


Switching my VM Base Memory for Win XP from 192MB to 512MB when I have 2.7GB of ram okay?

That completely depends on what else you run at the same time, but it should be fine. Track your Linux memory usage with free -m in a terminal window and if you start using even the slightest amount of swap, lower the RAM setting for the VM again.

When the OS runs out of actual RAM memory (which is, relatively speaking, blazingly fast), it has to use swap memory, which is a file or a dedicated partition on your harddrive (which is really slow, relatively speaking -- hundreds of times slower than RAM). Obviously, you don't want your system to run into this situation. Hypervisors (the programs that host virtual machines) tend to allocate the whole amount of RAM that you set aside for the virtual machine since allocating it bit by bit (what normal programs tend to do) would negatively impact the performance of the virtual machine guest OS.

The output of free -m looks about as follows:

username@hostname:~$ free -m
             total       used       free     shared    buffers     cached
Mem:          4025       1893       2132          0        306        956
-/+ buffers/cache:        630       3395
Swap:         4769          0       4769

As you see, the swap is not used in this case ("used" is 0). This is fine. But if you run many RAM-intensive programs, such as Firefox with a bunch of tabs (especially ones with Flash content), an image editor, and your virtual machine together, then you might be taxing your system's resources. If you computer feels like it's getting slower, you now know where to check.

I would also like to comment on the reply that quotes Ubuntu's minimum system requirements: these do not take your running applications into account, so they refer to what you need to just get the basic Ubuntu environment up and running. Any application you run on top of that environment will also require resources.


Try:

sudo update-alternatives --install /usr/bin/java java /usr/lib/jvm/jre1.7.0_15/bin/java -1
sudo update-alternatives --config java

See if that works.

Read more about it at man update-alternatives


This behaviour is controlled by the Ubuntu Dock gnome extension. It uses the same backend as the very popular Gnome Shell extension "Dash to Dock". There is no option to change the behaviour of the Super+Number keys. You can resort to a perhaps less perfect workaround.

Workaround: Disable that functionality of the dock. Then, use "Keyboard" - "Settings" to manually assign the Super+Number for launching applications according to how they are pinned on the launcher. For instance, assign the Super+1 hotkey to launch Firefox.

To disable the Super+Number functionality of the Dock, open a terminal and issue following command:

gsettings set org.gnome.shell.extensions.dash-to-dock hot-keys false

If you change your mind, you can restore the default behaviour with the command:

gsettings reset org.gnome.shell.extensions.dash-to-dock hot-keys

In practice, this will work very well for your pinned applications. However, the hotkeys will not automatically be updated if you change the order of your favourites. Also, you cannot have corresponding Super+Number keys for icons that are not pinned as favourites, because these icons change all the time.


No internet connection after update (17.04 to 18.04)

Run sudo service --status-all to determine if you're using WPA, connman, radar, curses, gnome nm or nmcl, wifi-menu and then you can reconfigure your network manager accordingly, If you have two network managers trying to run simultaneously them you'll have to remove one because they may be confused as their fighting in the background on who gets your service first... sounds like you may have had a default network manager such as wpa and you've tried installing gnome network manager for the applet but you never set their start up parameters, so now their clashing. Theres an endless amount of posibilities

It's also wise to change false to true in the Network Manager file if you're using Gnome network manager that way when you restart the manager the interfaces are restarted with it

If I were you I'd also have a look into the resolv.conf for the 3rd party nameservers such as 8.8.8.8 and 8.8.4.4 as all private isp nameservers are shit and can block certain pages, and be vulnerable with slow access. if your name server is set in dhcp then it will overwrite resolv.conf, but if it's set in the gnome network manager file then the manager will over write dhcp and resolv.conf, so it's really your pick as resolv.conf is just temporary.


I got OpenCL working with the nvidia 331.113 update.
You have to install nvidia-modprobe and reboot:

sudo apt-get install nvidia-modprobe


You can't use Windows drivers on Ubuntu.  You probably won't need drivers depending on your hardware.  I would recommend that you try Ubuntu before installing that way you'll know if all hardware works OK.

Boot from the Ubuntu CD/DVD or bootable USB, and choose try Ubuntu.


You need to install CompizConfig Settings Manager.

Then under
Ubuntu Unity Plugin -> Experimental -> Edge Stop Velocity
you control which is the maximum velocity of your mouse that will block it's movement and stick it to the edge.

My preference for example there is "20", which allows rather fast movement of the mouse to pass through, while when being slow, it properly sticks to the edge.


My understanding is that X will be able to run on top of Wayland as a client. See the diagrams at the bottom of http://wayland.freedesktop.org/architecture.html for example.

They only mention this in terms of being able to share input devices with X for backwards compatibility, but I presume it means that it will be possible to communicate with the X server over a remote connection even though it is running on Wayland.


How do I get a Epson Aculaser C1600 working?

This may or may not help, but this thread suggests that manually installing it as a HP LaserJet 4 will make it work. I assume they meant to install through the hplip drivers. Just manually specify the driver in the printer dialogue.

I'll be honest, I've no idea what the guts of this machine really are compatible but it's worth a punt.


13.04 64 bit / Kernel panic after updating Ralink rt5390 wifi driver

Its a kernel regression, the patch to fix the issue is here

https://patchwork.kernel.org/patch/2705091/


Ubuntu Budgie 17.10 Greeter Wallpaper black

Actually I found out what the issue was.

Apparently I am the only one having a simple color as a wallpaper.
In that case the login-wallpaper is broken and only shows a black wallpaper even a different color is selected.

Cheers


I found a tutorial on playing Native client games on Linux here.

First you need to check native client is enabled in chrome://flags or not.

Secondly you need to enable WebGL by running the command:

google-chrome --enable-webgl --ignore-gpu-blacklist

You can also do the same thing by going to chrome://flags and enabling 'Override software rendering list'

Lastly native client currently only works with chrome. It seems that some chromium builds are blacklisted temporarily because of a bug. You may also need to install proprietary drivers to stop getting 'graphic card not compatible' errors.


GRUB - ELF magic error message after installation - how to get dual boot option?

I managed to fix this by using the live cd and entering the commands:

sudo mount /dev/sda5 /mnt
sudo grub-install --root-directory=/mnt /dev/sda

I can successfully access both Ubuntu and Windows.


Chinese encoding in names of compressed files in zip

Try:

unzip -O cp936 "严蔚敏数据结构(c语言版)教材及答案.zip"


Uninstall every program that I've installed

There should be as if you go to the software centre you can see all the apps that are installed on your system. The only thing that I can think about if you were going to do a batch file would be that you would have to make it smart enough to determine which apps came with the system itself. Say a line like anything installed after the original install date.

Whist looking I did come across this line that produces a text file with all apps. I have not had chance to try it out yet so cannot say of it works. Thought it may be of help to you:

man dpkg
# `sudo` is not needed here
dpkg --get-selections > installed-applications.txt


How to force user to run quiz after login and before displaying desktop

Here's a super simple way. Have your quiz program run during the Xsession, right before the desktop gets launched.

For example, try creating a file (as root) called /etc/X11/Xsession/95quiz with the following contents:

xmessage "What is my favorite color?" -buttons "African Swallow,European Swallow,42" -print -center

Upon logging on, you will not be able to use the computer until the quiz program exits.

Of course, the way I have it setup, all users of the computer will be quizzed, which seems fair to me. Running it from only your kid's .xsession is left as an exercise for the reader. :-)


The mentioned package gstreamer1.0-plugins-bad is a package containing codecs needed to decode and play DVD video content. Here is its description:

Description-en: GStreamer plugins from the "bad" set

GStreamer is a streaming media framework, based on graphs of filters
which operate on media data.  Applications using this library can do
anything from real-time sound processing to playing videos, and just
about anything else media-related.  Its plugin-based architecture means
that new data types or processing capabilities can be added simply by
installing new plug-ins.

GStreamer Bad Plug-ins is a set of plug-ins that aren't up to par compared
to the rest. They might be close to being good quality, but they're missing
something - be it a good code review, some documentation, a set of tests, a
real live maintainer, or some actual wide use.

It is not installed by default in Ubuntu, because it contains proprietary or non-freely licensed codecs. You may still use them legally, but the Ubuntu developers preferred to only ship open-source software with the default installation.
The following command typed in a terminal window (Ctrl+Alt+T) should solve the problem:
sudo apt-get install ubuntu-restricted-extras

Alternatively, click the red button below which will take you to a site that helps you installing the package through your Software Center.
However, I strongly recommend using the terminal, because the other method might lead to problems because the Software Center fails to display you the License Agreement.

If you want, you can probably also just install the requested gstreamer1.0-plugins-bad  codec package only (not tested by me, I can't guarantee that this will work):
sudo apt-get install gstreamer1.0-plugins-bad


Can you post more details on your PC's configuration such as amount of memory, type of CPU, hdd or ssd etc. I have a Dell Inspiron 5675 Desktop PC with an AMD Ryzen 1700x CPU, 8 GB DDR4 Ram and Ubuntu 18.04 on a 500 GB ssd and an AMD RX580 graphics card. I get the same symptoms as you. Sometimes the usb keyboard will still be functional when the freeze occurs and I can use the Sysreq REISUB sequence to get out the the freeze and reboot gracefully. Other times both the usb keyboard and usb mouse are non responsive during the freeze. My syslog and kern.log files do not show anything before the freeze occurs so I am thinking it is an intermittent hardware problem.

I have tried using ssh to get into the PC from another machine when the freeze occurs but the connection is refused. I am slowly changing hardware bits and simplifying the configuration to see if it stops. It is a slow process since it can be a day or more between freezes. The same thing was happening with Ubuntu 16.04.4 on this hardware. So far I have changed the ssd, the OS (to 18.04 from 16.04 using a fresh install) and the mouse and moved the entire PC off my UPS power onto the mains power with no change - the random, intermittent freezes continue. Next I will change the power supply and the graphics card.

The PC passes all of Dell's built in extended UEFI hardware tests but given the intermittent nature of the freezing problem that doesn't surprise me. This is a very sly and slippery problem since I can't find a trigger for it.

Also found this bug report https://bugzilla.kernel.org/show_bug.cgi?id=196683 which mentions the above symptoms caused by the C6 C-state of the Ryzen processors being turned ON. An apparent fix is to turn C6 OFF in the BIOS or in the Linux kernel or via a script run at start up as a cron job. This could be the culprit.


"E: Unable to correct problems, you have held broken packages" when trying to install a package. Nothing has worked from other threads

The answer is simple. There isn't the right libstdc++6 in the Ubuntu repositories for Trusty. You need an additional PPA.

sudo add-apt-repository ppa:dolphin-emu/gcc-for-dolphin
sudo apt-get update


How do I make a Windows-style cls script for Ubuntu?

Make a script, name it cls, make it executable (chmod +x cls), and give it these contents:

#!/bin/bash

printf "\033c"

Before you add it to your path, you may want to make sure there are no programs called cls already:

update-alternatives --config cls

Then, to add it to your path system-wide, put your script in a safe system location, such as /opt/bin/cls and use update-alternatives to add it to the path for all users:

sudo update-alternatives --install /usr/bin/cls cls /opt/bin/cls 0

You can place your script in ~/bin (the tilde stands for your home directory) for it to be in a single user's path (if you had to create the bin directory, you'll need to restart your computer before it will be in your path. There's no need to do anything with update-alternatives in this case.


I am unable to install any program in ubuntu 14.04. What should I do?

It looks as though you have broken packages. Please try the following:

sudo apt-get update
sudo apt-get -f install
sudo apt-get install vlc

First line makes sure you have updated sources for your packages.
Second line attempts to correct a system with broken dependencies in place (from apt-get help).


Can I remove some packages with one command?

The command to remove a package and its configuration is apt-get purge. It can accept multiple package names as argument:

sudo apt-get purge apache2-mpm-itk apache2-utils apache2.2-bin and so on

It may happen that /etc/apache2 remains untouched after removal, in that case remove it manually with:

sudo rm -rf /etc/apache2

Be careful when typing this command or you may regret it.


I figured it out.. Just edit lxde configuration file and replace openbox-lxde with kwin.


Yes, both rsync and Unison (among many other tools) will accomplish what you want. The difference between those two is that rsync is more minimal, like a beefed up cp or scp, and you will have to write some clever scripts and/or cron jobs to get the setup you want, while Unison takes care of more things itself. See the Unison tag wiki for more info.

Also, check out all the other sync utilities available too.


If you execute postconf -d 'content_filter you could see default value for content_filter in postfix configuration file and from there you could again set that value with postconf -e command.


Using the tools provided with ImageMagick

We can easily join, i.e. "montage" images into one large image with the following command
montage -geometry 500 image1 image2 [...] output

See the project page for many parameters of the geometry option. CAUTION: the output argument is non-optional, having just two images on argument list ends up replacing image2 without warning. In the example above all images will be scaled to a width of 500 pixels before they are joined. Adapt this value for your image sizes. In case you need to have a fixed height choose x500 instead. The other dimension will be scaled to preserve the aspect ratio.

Inspired by this post saying that ImageMagick has command line tool named convert to merge images. To join images horizontally (in alphabetical order):
convert +append *.png out.png

To stack images vertically:
convert -append *.png out.png

That should be run in a terminal into the folder containing png files to join them all.
A gui for that would be:
a file manager context menu to join selected images.
An easy way when it comes to that is Thunar's custom actions:
To join selected images vertically (into one png file, in alphabetical order, no matter their extension) add this custom action:
convert -append %F joined-vertical.png

To join horizontally:
convert +append %F joined-horizontal.png

For a more sophisticated way to assemble images you may want to search for panorama photo  stitcher software such as hugin

or the Pandora plugin for Gimp.


System wide files are in:

/usr/share/applications/

And user only ones in:

~/.local/share/applications/


How can I stop my Webkit browsers (except Chrom(ium/e) start LibreOffice and Acrobat when loading plugins?


The 2.6.39.2 kernel is named "oneiric" - but according to this ubuntu mailing list entry, this kernel is the generic kernel without any specific modifications for ubuntu & oneiric.

You will need to install the kernel yourself:

Browse to the following location on Launchpad - link is below.

If you have a 64bit system download the two amd64.deb files.

If you have a 32bit system download the two i386.deb files.

In addition download the "_all.deb" file.

then install the downloaded debs

cd Downloads
sudo dpkg -i linux*.deb

Then update your grub

sudo update-grub

http://kernel.ubuntu.com/~kernel-ppa/mainline/v2.6.39.2-oneiric/


How can I stop Ubuntu taking over as default OS on Mac, or at least reset macOS as default from within Ubuntu?

On the lastest version of Ubuntu (20.04) and on current versions of macOS (Catalina or Big Sur) this works to reset to macOS and stay reset:
As a one-time step, add this line to your Ubuntu .bashrc file:
alias osx='sudo efibootmgr -o 80,0 && reboot'

From then on, when you want to reboot into macOS, open a terminal in Ubuntu if you haven't got one open already.
Type osx and press return.
Enter your password if required.
This should reboot you back into macOS. If you have more than one macOS, it will reboot back into whatever was the previously selected macOS default. It is 'sticky' (macOS stays set back as the default).
There is no equivalent way back from macOS to Ubuntu; reboot while holding down Alt/Option as normal. But that is okay because Ubuntu stays selected once you've chosen it; unlike macOS without this method.
[Worked out after a fair bit of research, with the help of efibootmgr in Ubuntu and bootoption in macOS!]


Here you can read this:

  Ubuntu 12.04+ uses a hybrid system called upstart which includes SysV runlevel specific start scripts in /etc/rc.#/ but also systemd scripts for those services which have been ported in /lib/systemd/system/. See "man 7 upstart-events" for details.


I understand that you've installed Okular from snap. It seems that the file okularpart.so either got corrupted or its permissions changed. You can try the following things to fix Okular until one succeeds:

Try to refresh the snaps: sudo snap refresh
Try to remove and reinstall Okular: sudo snap remove okular && sudo
    snap install okular
Remove Okular snap and give a try to apt install: sudo snap remove okular && sudo apt install okular (there are quite a lot of dependencies if you use a GTK based environment such as Gnome)


What files get erased when installing Ubuntu by erasing my current Windows OS

Everything on the disk will be erased.

Every single last file.

Even the MBR.

However, if you would like to save your files, you can do that easily. There are two ways of doing so:

Install Ubuntu in a dual-boot with Win 7 (this is an option in the installer).
Buy an external USB hard drive, and drag&drop your C:\Users\youruser folder onto it. Then, after installing Ubuntu, you can plug in the external disk, and Ctrl+a everything in the documents folder, and drag them in Ubuntu's documents folder. You can do the same for the pictures and videos folders.


Is it possible to send and receive the whole system traffic through firefox?

This is not possible. Firefox can only handle traffic like HTTP/HTTPS, FTP, etc and the addon would only be able to use the proxy for traffic happening inside of Firefox.


Update doesn't run automatically on Ubuntu 16.10

How to check if unattended upgrades is working:

1) Check the timestamp in /var/lib/apt/periodic/. Most apt-related applications timestamp their successful run there.

Here is an example. You can see that u-u ran Jan 30 at 01:38

$ ls -l /var/lib/apt/periodic/ | grep unattended-upgrades

-rw-r--r-- 1 root root 0 Jan 30 01:38 unattended-upgrades-stamp

2) Check the log. Unattended-upgrades logs all actions to /var/log.

Here is an example for the same January 30 activity:

$ cat /var/log/unattended-upgrades/unattended-upgrades.log | grep 2017-01-30

2017-01-30 01:38:22,190 INFO Initial blacklisted packages:
2017-01-30 01:38:22,254 INFO Initial whitelisted packages:
2017-01-30 01:38:22,254 INFO Starting unattended upgrades script
2017-01-30 01:38:22,255 INFO Allowed origins are: ['o=Ubuntu,a=yakkety-security']
2017-01-30 01:38:26,336 INFO No packages found that can be upgraded unattended and no pending auto-removals

How to check when unattended upgrades will run next:

In Ubuntu 12.04 and 14.04, unattended-upgrades runs with other daily maintenance triggered by /etc/cron.daily. See your root crontab for the time it runs each day.

In Ubuntu 16.04 and later, daily apt maintenance is assigned a random time by systemd.

Here is an example of how to query systemd to see the daily apt timer (cleverly called 'apt-daily.timer'):

$ systemctl list-timers apt-daily.timer
NEXT                         LEFT          LAST                         PASSED
Tue 2017-01-31 10:12:03 CST  4h 49min left Mon 2017-01-30 19:18:19 CST  10h ago

Note that the LAST timer for Jan 30 (19:18) does not match the actual run time for Jan 30 (01:30). The system was suspended or turned off at 01:30, systemd ran the missed timer when the system became available again. Note also that the NEXT timer is unrelated to the previous day...each day is random.

That randomness means that it's probable that a not-always-on system will miss a couple daily upgrades each week. This won't harm your system, but may understandably confuse the user.

Wait, no timestamps. How do I turn on Unattended Upgrades?

Unattended upgrades is installed but OFF by default in Ubuntu 14.04 and earlier.

The simple way to turn it on in 14.04 and earlier in Unity is System Settings --> Software & Updates --> Updates Tab. The settings are easy to understand.

If you are not using Unity, try the following and look for the 'updates' tab.

$ software-properties-gtk

Unattended upgrades is installed and ON by default in all flavors of 16.04 and later. Use the same method to change many settings.

For power-users who need special configurations, u-u settings are stored in various files in /etc/apt/apt.conf.d/, mixed in among other apt settings. The GUI uses these settings.

Okay, Unattended Upgrades is running, but why do I still get notifications about uninstalled updates?

The default setting for u-u (located at /etc/apt/apt.conf.d/50unattended-upgrades) is to download and install packages from the -security repository only. -upgrades and -backports and everything else are ignored...and you will be notified that those uninstalled upgrades are available for you manual approval.

You can edit that file (as sudo) to add other sources.

WARNING: Unattended-upgrades is not clever. If you foolishly add sources that will break your system (like -proposed or some PPAs), it will do so. You have been warned.


How to display Dash Home by keyboard shortcut

Super key is the default key for opening dashboard.

You can find more help from this link

or otherwise you can use Compiz Configuration Settings Manager for changing keys

install compizconfig-settings-manager

sudo apt-get install compizconfig-settings-manager

After that open dash and type ccsm, then go to unity plugin option

Change key from here.


Did you ever seen a popup like this one? This is the easy way to install proprietary video drivers (I have nVidia but the procedure should be the same). Otherwise you can try the official Ubuntu page that also explains how to install Catalyst drivers. Finally, you can also look at this thread: the command line tool to call the "restricted drivers" window from the shell should be jockey-text.


Is it possible to do during the installation?

No. That is something you need to do after installation. Possible method: you could add the commands for that to a "preseed" file as "post" installation actions.

  Is there any reason why it could be bad?

Bad? No. But I would not expect it myself.

If all you are concerned about is databases in /var/ the more logical method would be to move the database storage settings. MySQL has a setting for where it stores it database (datadir in my.cnf. So does Postgres (data_directory in postgres.conf).


Trackpad not working on thinkpad after upgrade- help?

If reinstalling synaptics doesn't work. Try adding this to your /etc/X11/xorg.conf file. You should have it if you have the nvidia driver installed. If not create one.

Section "InputClass"
    Identifier "touchpad"
    Driver "synaptics"
    MatchIsTouchpad "on"
        Option "TapButton1" "1"
        Option "TapButton2" "2"
        Option "TapButton3" "3"
        Option "VertEdgeScroll" "on"
        Option "VertTwoFingerScroll" "on"
        Option "HorizEdgeScroll" "on"
        Option "HorizTwoFingerScroll" "on"
        Option "CircularScrolling" "on"
        Option "CircScrollTrigger" "2"
        Option "EmulateTwoFingerMinZ" "40"
        Option "EmulateTwoFingerMinW" "8"
        Option "CoastingSpeed" "0"
 EndSection


How can I change the working directory in a launcher on MATE 16.04?

The simplest workaround I can think of is to write a wrapper script:

#!/bin/sh
cd /home/username/KSP-RO_1.3.1 && KSP.x86_64

Save the script as ~/bin/run_ksp.sh, make it script executable (chmod 755 ~/bin/run_ksp.sh and then use a launcher pointing to that script instead.


How do I get rid of "U3 System" on my USB drive?

The solution came from u3_tool (universe), which can:

uninstall the U3 software
reclaim the CD-ROM disk space
run on Ubuntu

I ran sudo u3-tool -p 0 /dev/sdb and then repartitioned the drive. Now it mounts like a "normal" USB drive.


I ran minecraft.exe on wine and a black screen popped up

Run minecraft in Linux instead.  You will need a version of Java, OpenJDK7 works well, or you could go to the trouble of installing Java 8.


How To Show Shared Data History using Ubuntu?

You need to edit the log level in smb.conf : https://www.samba.org/samba/docs/man/manpages-3/smb.conf.5.html#LOGLEVEL
Then you can type log file = /var/log/samba/log.%m.%U in smb.conf to log per machine and per user.


Screen Brightness not staying at the brightness I selected

According to proxeIO answer, You can edit /etc/default/grub file:

sudo nano /etc/default/grub

And change the GRUB_CMDLINE_LINUX_DEFAULT="quiet splash" line to

GRUB_CMDLINE_LINUX_DEFAULT="quiet splash pcie_aspm=force acpi_osi="

Then run this command, that applies the changes:

sudo update-grub


could someone explain the outcome entries into a file?

if the output of ls -l is

-rwxr-xr-x 1 root root 523454 Aug 8 2014 name

The number 1 refers to the number of hard links to that file. Hard links are basically just an additional name for an existing file or folder. For more info on hard links, visit this site. You can view this answer for more information

lrwxrwxrwx refers to a link that can be read, written and executed by the owner, group and others.


Are you sure that the binary is called subl&? Is quite strange. To do what you are trying to do you should put the ampersand at the end of the command:

subl hw1.py &

If you don't want that the program exits when you close the terminal, use:

nohup subl hw1.py &

or

subl hw1.py &
disown


You appear to be mixing packages from the Ubuntu archive with those from some external source (0.7.3-bt0 does not look like a version number used by the package in Ubuntu).  In particular, the non-distro package for ettercap-gtk appears to contain files that have been split out into a separate ettercap-common package in Ubuntu.

Perhaps try disabling the additional package sources, run apt-get update and then try again?


How to create a folder or file using a specific user permission in Ubuntu 14.04

The user omar would have to either have root access or know the password of demo.

He can su to demo's access and create files under demo's permission with:

$ su demo

He would be prompt for the password of "demo" and could proceed to create the files with the desired permission.

He could do the same with root permission with:

$ sudo su demo

Or he could directly change the permission with:

$ sudo chown demo /var/www/[folder to change]

Since the folder you want to create is in the /var/www area, by default neither omar or demo would have write access to that particular folder and would need root access to start the action.


I believe your issue is because your missing the username in the SSH connection.

ssh ubuntu@172.16.103.12


How to speedup Ubuntu when user home directory on NIS/NFS?

I've deployed Ubuntu desktops on gigabit networks before, and despite it being fast, it's not as fast as a local disk, especially with applications that use lots of small little files, like say, your browser profile directory.

Without looking at your set up, I am reasonably certain that this is the case as it's always been a problem with NFS home directories and programs like this. One of the things you can do to mitigate this problem is to cache NFS on the PC you're on:

How can I cache NFS shares on a local disk?

I've deployed something like this in the past and it helped, but having home directories on a network filesystem can lead to things like this. Something you might want to consider instead is having the home directory be local, but then having a subdirectory underneath that is on NFS instead.


There is a know bug that can be solved by this:
Lets make a backup first:

 sudo cp /usr/lib/battery-status/battery-status /usr/lib/battery-status/battery-status.bak

And then:

 sudo sed -i 's/BAT0/BAT1/g' /usr/lib/battery-status/battery-status


global is a flag, so the command you tried to run should be like this instead:

git config --global user.name

So if you want to configure your username and email, you need to run the following commands

git config --global user.email "bob@google.com"
git config --global user.name "Bob Saget"


MaaS Enlistment through 12.10 installation CD fails (SIGKILL problem)

Once a node has enlisted it is shut down and the status will be "Declared" in the MAAS web interface. The next step is to edit the node settings then click "Accept and Commission".

After clicking "Accept and Commission" your machine will power on automatically if you configured IPMI. If not, you will need to power the machine on again and it will show as "Commissioning". Once the node is commissioned it will power down again and show as "Ready"

When you deploy a service with juju the machine status will become "Allocated to ". Power on the machine again for the service to deploy.


The issue I found on my Ubuntu with Python was that I upgraded pip install --upgrade certifi... And then it took me hours trying to understand why things do not work...
Only once I had seen different versions here, that I started thinking in the right direction...

vitaliy@vitalnuc01:~/HANAClientsTutorial/python$ dpkg -l | grep python3-certifi
ii  python3-certifi                            2018.1.18-2                                         all          root certificates for validating SSL certs and verifying TLS hosts (python3)
vitaliy@vitalnuc01:~/HANAClientsTutorial/python$ pip3 search certifi
...
certifi (2020.4.5.1)                        - Python package for providing Mozilla's CA Bundle.
  INSTALLED: 2020.4.5.1 (latest)
...

So...

pip3 uninstall certifi
sudo apt-get install --reinstall python3-certifi

...and Python-based programs started working for me again.

And yes, I was close to reinstalling my Ubuntu as well :)


Ubuntu 19.10 l2tp VPN doesn't work anymore

Apparently, Ubuntu is not really happy with using 3des as handshake cipher, but I managed to make it work.

You may want to set the phase 1 and 2 algorithms using a final exclamation mark, like so:

Phase 1: 3des-sha1-modp1024!
Phase 2: 3des-sha1!

I tested this with network-manager-l2tp 1.2.10-1, network-manager-l2tp-gnome 1.2.10-1 and Ubuntu 19.10

Hope this solves your issue too.

Regards.


How to upload/build a custom kernel on launchpad?

Works for me when I use ftp and set allow_unsigned_uploads = 1.

The easy way: FTP in Ubuntu 9.10 and newer

First, you need to tell dput where to send your package and by what method. To do that, edit ~/.dput.cf to look like this:

[my-ppa]
fqdn = ppa.launchpad.net
method = ftp
incoming = ~<your_launchpad_id>/ubuntu/<ppa_name>/
login = anonymous
allow_unsigned_uploads = 1

Then run something like this:

dput my-ppa my-ppa.changes
Uploading to my-ppa (via ftp to ppa.launchpad.net):
  Uploading my-ppa.deb: done.
  Uploading my-ppa.buildinfo: done.
  Uploading my-ppa.changes: done.
Successfully uploaded packages.


Try go to the terminal and write this:

sudo halt

Enter your password when prompted and press enter, and then it should shut down.


Cannot boot in Ubuntu 13.04 on Windows 8

Explanation:
The error message you got means you tried to install Ubuntu inside Windows (via the Wubi installer).
The problem is that Wubi is incompatible with GPT (preinstalled Windows8 use GPT).

Solution: install Ubuntu the standard way, on its own partition. (see https://help.ubuntu.com/community/GraphicalInstall )


How do I install llvm-3.4 on Ubuntu 17.04 (x86_64)?

you can't install llvm-3.4 on Ubuntu 16.04, the only available versions are llvm-3.5 and up. Since you are using Ubuntu 17.04, install llvm-3.5 by :

sudo apt-get update
sudo apt-get install llvm-3.5


Unable to login with static port on xrdp

Well it seems that I have found a solution.

I ran this command to see available tcp ports on PC

netstat -an | grep tcp

I could see that port 5910 was available and I set port to port=ask5910 within [xrdp1] in /etc/xrdp/xrdp.ini.

ex below,

[xrdp1]
name=sesman-Xvnc
lib=libvnc.so
username=ask
password=ask
ip=127.0.0.1
port=ask5910

After I did this then remote desktop with static port 5910 worked. Not sure why it worked now because I have tried this port before and it did not work then. I did not do any changes since but for some reason it works now.


HyperV integration services v3.4 for 12.10?

I have 75Mb-85Mb/sec transfer with this driver

ICs v3.4 can be downloaded at http://www.microsoft.com/en-us/download/details.aspx?id=34603

Also download Linux Integration Services v3 4 Read Me.pdf. There is instructions.


How to connect a projector to my Ubuntu laptop?

I didn't use booting. just go to System Setting > Display. Set on another display and 800x600 resolution and then press apply. no problem at all on Ubuntu 14.04.


Checking on the Network settings (while pinging google from a terminal, at the same time) if I disable the network and put it back up again, the ping stops and goes on again, which is fine. But, if I open another terminal and ping there google, it won't which is weird.
I looked again in the Network settings and saw IPv6 being turned on. I am not entirely sure if this was turned on before, but I tried to turn it off. After doing that, everything seems to work fine again. I guess that must be it.


Putty SSH Session closes immediately after login with latest ubuntu 18.04.2 LTS Update

Guess I asked prematurely. Not sure what was going on after the update, but CPU and network usage spiked. After it stopped I rebooted a second time and now it's working correctly.


Install the correct Nvidia driver version for NVIDIA CUDA Toolkit

Sorry about posting this as an answer, I'm not able to post a comment to ask you this. Can you show the output of sudo lspci | grep -i nvidia? That might show what GPU it is.

edit: I don't think this is a duplicate. the output of lshw would typically have the name of the GPU, which you could use to install the right driver. Here's what it would usually look like:

  *-display
       description: VGA compatible controller
       product: GK107GL [Quadro K420]
       vendor: NVIDIA Corporation
       physical id: 0
       bus info: pci@0000:02:00.0
       version: a1
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress vga_controller bus_master cap_list rom
       configuration: driver=nouveau latency=0
       resources: irq:49 memory:fa000000-faffffff memory:e0000000-efffffff memory:f0000000-f1ffffff ioport:e000(size=128) memory:c0000-dffff


Assigning servername to a local ip in apache/ubuntu

This depends on how wide you want this domain to work. If this is only for your personal use, you can add the following line to your /etc/hosts, and it would start working on your computer. Unless you are willing to buy sdk.sat from a domain registrar, you would also need to add the same entry to any other clients willing to access the site.

127.0.0.1 sdk.sat

Note that you'd need admin rights to edit the hosts file. So use gksudo gedit /etc/hosts

For any other computer make sure to use a network accessible ip address, such as 192.168.x.y(if its a LAN) or perhaps your internet accessible IP address.


The xubuntu-desktop is a meta-package. That means, that it's a package that serves as a single point linking to other packages. Something like a pointer to many other different packages.

Hence xubuntu-desktop package's only contents are links to other xfce related packages, the packages that make up the Xubuntu Desktop.

You could also read the Ubuntu Community Documentation on MetaPackages


When you installed Ubuntu using WUBI, you created a "virtual partition" inside a 30GB file called root.disk inside a ntfs partition /dev/sda4 that has the mount point /host.

Trying to copy Ubuntu from the file inside /dev/sda4 it to the partition itself which may have unexpected results. As with all disk and partition manipulations make backups of all the data, particularly the Ubuntu home folder and generally everything else in the computer. If something goes wrong, you may have to start from scratch and reinstall Ubuntu.

Ubuntu should be installed in an ext4 formatted partition. Since currently /dev/sda4 is formatted ntfs, formatting it ext4 will result in loss of all the data including the root.disk file.

One solution may be to move the wubi installation to C:. This is not straight forward. See https://lists.ubuntu.com/archives/ubuntu-users/2011-October/253085.html for details.

Make sure that Ubuntu works after moving the WUBI files to another partition. If not, revert the changes.

Once wubi is moved to another partition, you should be able to format sda4 to ext4 and make the mount point "/."

If things go south you may have to install Ubuntu in its own partition from scratch. I would suggest deleting sda4 and sda5 make that unallocated space. Ubuntu installation should find the space and create the two partitions.

Alternately, select "Something else" as the type of install to format sda4 to ext4 and choose mount point "/" at the time of installation.

Keeping the same username in the new install as in the previous WUBI install will prevent problems with permissions of backed up files when they are restored.


Laptop with Nvidia + Intel cards does not find HDMI monitor with intel

It turned out to be a problem of the prime select mode of the Nvidia card as discussed here. Disabling the nvidia-drm modeset solved the problem for me.


Unable to record with my headset on LiveMocha.com using and Flash 11

I am not trying to revive a dead horse, but I had this exact same issue.  The sound settings menu has two issues.  There is no way to automatic change input to headset even if it is the only input.  I had to change input manually even though recorder worked.  Also, there is an alsa plugin that chrome uses while it is trying to record.

Steps:

Change soundsettings menu input to headset
Start recording in Livemocha.com
Raise the volume of the plugin in the applications menu.

It's a bad hack, but now people can use livemocha with 11.10


GIMP icon in GNOME Classic's window list changes after opening an image

I fixed this by finding .desktop file for Gimp find / | grep gimp.desktop and adding new line with StartupWMClass=Gimp-2.10. But this solution is version-specific and needs to be updated with each new version release.
You can find your Gimp's WMClass with xprop WM_CLASS command and clickling into Gimp window.


Is it possible to install software from hard disk?

This all depends on what type of file you're trying to install. If it's a .deb just run

sudo dpkg -i <deb-file>

If it's is a .tar.gz or .tar.bz2 it's most likely a source package. That means you will have to compile the application on your computer. This is usually described in a file in the archive called INSTALL or README. The most common way for these are

tar zxf <file.tar.gz> 'or' tar jxf <file.tar.bz2>
cd <dir_from_package>
./configure
make
sudo make install

Of course installing source packages require that you have a compiler and the development libs required for the program you wish to install. Since you are on a ubuntu system I suggest you stick to installing .deb supported by the ubuntu version you're using.


Why is chmod not recognizing file operators

This error only happens if you dont have any file on the current folder. Execute the ls command to check it.


Giving Windows user permissions in Samba shares

I don't know complicated the permissions per user you require but does something like this work for you : https://ubuntuforums.org/showthread.php?t=2453008
In that situation the user created a share of one folder ( /FolderRoot ) with many subfolders with the intent that only some users would have access to each subfolder.
He wanted the parent folder and the whole tree to be read/writeable to only one user ( User1 ) for which I suggested this:
[FolderRoot]
path = /FolderRoot
read only = no
valid users = User1
force user = UserMaster

Then he wanted a subfoler that only User1 and User3 could access. I suggested just creating a different share of that subfolder like this:
[Folder2]
path = /FolderRoot/Folder2
read only = no
valid users = User1, User3
force user = UserMaster

You might want to look at the original posters question to see how applicable his use case is to yours.


Utility/Sniffer to track internet traffic/speed of all PCs in local network

Wireshark will work if you can span a gateway connection in order to see all the PCs traffic.  Otherwise, you'll only see your own.

If your PCs support SNMP, I think your best bet will be a tool like Cacti.  This way you run Cacti on a central PC/server, which then polls the other PCs for interface information and graphs the resulting interfaces for comparison.


Upgraded Apache Server won't start: Syntax error on line 141 of /etc/apache2/apache2.conf

To solve the error seems that you just need to create some *.conf file into the '/etc/modsecurity' directory. Copying  modsecurity.conf-recommended into  modsecurity.conf might be a safe option.

Read carefully the  modsecurity.conf-recommended file to see if it fits your needs, i'm not using apache since years


Two Docks are shown when Super key is pressed

This appears to be a bug with the dash-to-dock extension:

Bug #855

Some workarounds include:

  Toggling the 'Show on all monitors' corrected this issue for me. I'm not sure why

Or

  It looks like dash-to-dock isn't properly replacing/removing/etc (or whatever you do to default) the default dock. I was able to

cd /usr/share/gnome-shell/extensions/
sudo mv ubuntu-dock@ubuntu.com ubuntu-dock@ubuntu.com.bak

  and then Alt-F2 'r' to manually fix it.


installation error media is either dirty or damaged

I would recommend using the usb to install ubuntu instead of a cd-rom. Save the .iso file to from the ubuntu.com/downloads

Then download linux live from http://www.linuxliveusb.com/en/download and run it.

While running the program,insert the usb drive you want to boot ubuntu from and select the .iso file and the program burns it to your usb drive.

Boot your laptop from external device(1st priority) and install ubuntu.