How do I increase PPPoE MTU? I have an Ubuntu Server 14.04 install which is connected to the internet using PPPoE. At the moment my ppp0 interface have an MTU of 1492 which mostly works.

I'd like to increase the MTU to 1500, which is supported by my ISP.

So far I have increased the MTU of the underlying Ethernet interface to 1508, and I have tried adding the following lines in /etc/ppp/peers/dsl-provider

mtu 1500
mru 1500

But my ppp0 interface still has an MTU of 1492. I believe the syntax of my added lines is correct, since using values lower than 1492 does work as expected.

Manually changing the MTU of the ppp0 interface to 1500 after it has been brought up works, but it only affects packets in one direction. Doing that I am able to send 1500 bytes packets across the internet and they will arrive at their destination with no fragmentation. But incoming traffic to me is still sent in 1492 byte fragments.

By capturing traffic on the Ethernet interface as the PPPoE connection is brought up, I can see that in the configuration request that my Ubuntu Server 14.04 machine sends to the provider, the MRU is specified as 1492. So I know the issue is on my end of the connection.

Why does Ubuntu Server 14.04 use 1492 as MRU in the configuration request, when the configuration file says 1500? And how can I change it to 1500?

I downloaded the ppp source code by typing these two commands:

sudo apt-get build-dep ppp
apt-get source ppp

In the header file pppd/plugins/rp-pppoe/pppoe.h I found this:

/* Header size of a PPPoE packet */
#define PPPOE_OVERHEAD 6  /* type, code, session, length */
#define HDR_SIZE (sizeof(struct ethhdr) + PPPOE_OVERHEAD)
#define MAX_PPPOE_PAYLOAD (ETH_DATA_LEN - PPPOE_OVERHEAD)
#define MAX_PPPOE_MTU (MAX_PPPOE_PAYLOAD - 2)

ETH_DATA_LEN is defined in /usr/include/linux/if_ether.h

#define ETH_DATA_LEN      1500            /* Max. octets in payload        */

And in pppd/plugins/rp-pppoe/plugin.c I found this:

    if (lcp_allowoptions[0].mru > MAX_PPPOE_MTU)
        lcp_allowoptions[0].mru = MAX_PPPOE_MTU;
    if (lcp_wantoptions[0].mru > MAX_PPPOE_MTU)
        lcp_wantoptions[0].mru = MAX_PPPOE_MTU;

What all of this means is that the rp-pppoe plugin has a hard coded limit of 1492 bytes. And the only way to increase it is by modifying the source and rebuild the plugin with a higher limit.

By removing the above four lines from plugin.c and rebuilding the module, I was able to increase the MTU from 1492 to 1500. This only works as long as the underlying line is known to support the larger size, which happens to be the case on my connection.

In order to detect the capability of the underlying line it would be necessary to use a newer pppd version with RFC 4638 support. Ubuntu 16.04 has a newer pppd version and thus should be capable of using larger MTU sizes for PPPoE without needing to recompile any code.

you could run pppd via strace and filter to display 'open' requests to see which files its opening to get its config from.

sudo strace -f -e open pppd

In my experience (of uk broadband) all connections have been 1492 if they go over BT , is there a specific reason you need another 8 octets ?

My understanding is that if you don't match the MRU properly you can end up having your packets become multiple packets, especially if you don't allow things like an 8 octet overhead for encapsulation.


Vim: Exit (:wq) with trailing exclamation mark ! What's the purpose? If one leaves an edited file with :q!, then it discards the updates.
If one leaves with with :wq, then it writes the updates and quits Vim.

But what's the purpose of :wq! (with a trailing exclamation mark)?

I have found no good explanation about that.

"!" means don't nag me with warnings; just do it.

If you try and vim /etc/hosts, and make changes and try and save with :wq! - the "!" is moot.  That is a real error that can't be forced thus use of "!" won't work.

A useful example..

touch ~/example
chmod -w ~/example
vim ~/example

If you open a file where you have READ access only but have taken away your WRITE access before hand,  that warning can be overridden by the "!" (unlike permissions error in /etc/), thus a ":wq!" in this case is handy (quicker than jumping to shell to fix).

:x! does the same thing and I have no idea where :wq! came from in modern documentation since it was obsolete 4 decades ago.

The problem with wq! is does that mean write then force quit or force write and then quit? With x! it is clear.


How do I enable pressure for my Wacom Intuos L? I saw a few answers that give a very long procedure to install some drivers but they are very old.  The tablet works but there is no pressure sensitivity Not in Krita, MyPaint or Gimp.

What version of Ubuntu do you have? It's likely that you already have the drivers you need. Ubuntu comes with Linux Wacom Project's Wacom Kernel driver (input-wacom), X driver (xf86-input-wacom) and libwacom xf86-input-wacom. I checked here and the Pro L seems to be one of the supported devices.

You can change the pressure settings for the stylus itself via command line (personally I have not gotten the GUI, in gnome-system-control, to work).

Check that the tablet is being recognized by your computer by opening Terminal or another CLI and entering:

lsusb

Now enter:

  xsetwacom --list devices

This should return a list of elements of your tablet that are configurable. In that list, you should be able to pretty easily identify which one is your stylus. It should look something like

  Wacom Intuos L 6x9 Pen stylus     id: <XX> type: STYLUS

where <XX> stands in for some number that gets assigned to that component. The part to the left of the id number is the name of the component, which you will call when changing  its settings, so you need to remember that. Please note that the name might not look exactly like what's above--the dimensions (6x9) might be different or not there at all, or it may be called Wacom Intuos L 6x9 Pen (without the "stylus")--use the specific name that you see listed in your Terminal output.

Since you already know which specific property you want to edit, you don't need to go through the trouble of searching through all the possible parameters. You want to change the PressureCurve setting for your stylus:

  xsetwacom --set "<NAME>" PressureCurve 0 20 80 100

"xsetwacom --set" tells your computer that you want to change the settings, the name of your stylus replaces <NAME>, PressureCurve is the specific property you're changing the values of, and "0 15 85 100" is just an example setting--this is the part you probably will want to tinker with. I ended up liking 0 12 92 100 for Gimp.

For reference, if you had zero sensitivity for your stylus (it's either "off" or "on"), the PressureCurve setting would be 0 0 100 100

If you wanted to see the other settings available to be changed, enter

 xsetwacom list parameters

However, I suspect that the real issue that you're having is that within each program (like Gimp, Krita), you need to configure your tablet. I grabbed my boyfriend's tablet to test out my answer to your question, and at first I was stumped because I knew I had the drivers, that his tablet was supported, and the device was being recognized, but when I tried drawing in Gimp, changes in pressure were not having any effect.

With Gimp, you have to activate your tablet first. And while it isn't a highly technical process, it is a bit tedious. So I'm afraid my response is going to look really long, but it's not difficult to set this up, just a bit time consuming--I promise!

Go to Edit > Preferences > Input Devices then click Configure Extended Input Devices. You should see the different elements of your tablet listed. From there you can click on the pen element of your Intuos, and you'll see a drop-down menu next to Mode. Change the mode from Disabled to Screen. You can edit the Pressure Curve here to change sensitivity settings. I also tried enabling the Pad element (from Disabled to Screen) and left the pressure curve alone--I liked the results better when the pad was disabled and only the pen was enabled, but I don't know know many of the nitty gritty details about how tablets work, and you may want to play around with how these two elements interact when they're both enabled.

Beyond that, the tools in Gimp themselves have Dynamics options that can change the effect that input from your tablet has on what you're drawing. If you don't have a Tool Options dialog box open, open one up (I dock mine under my Toolbox). You should see a Dynamics section near the bottom. There are multiple profiles you can pick from, like Pressure Opacity, or you can add a custom one by clicking the button with the blue arrow and three red dots. This opens a drop-down menu of all existing profiles, and at the bottom of the list you'll see a plus sign button. Click that to make a new Dynamics profile. (See here for more info on Gimp/tablet use).

I can't walk you through Krita tablet configuration, but here's a link to their documentation on using tablets with the program.

I couldn't find a detailed walkthrough to tablet setup with MyPaint 1.2 (the newest version), but here's one for version 1.0. Unfortunately, I don't see your specific device listed in their supported devices list, although there are a lot of Wacom tablets in there.

Here's a guide to setting up tablets with Inkscape. It's probably the most popular vector graphics software compatible with Ubuntu. I've used it and really liked it.

Finally, you might also want to know that it's possible to write profile scripts so that the baseline pressure settings are different when you're using a specific program, like if you wanted lower pressure sensitivity when using Krita. You'd write a bash script that executes xsetwacom --set "<NAME>" PressureCurve X XX XX XXX, create an executable launcher for it, and click on the launcher before using Krita. More info can be found here.

Other sources: linuxwacom github page and wiki.

My Paint >>> Window >>> Edit Preference >>> Pressure (Global Pressure Mapping)
Wacom pressure on MyPaint app in Ubuntu studio 16.04


How to view 3D PDF files? Is it possible to view 3D models with PDF documents?

There are a number of PDFs which contain detailed 3D models such as this example:   http://www.carare.eu/eng/content/download/2718/21413/version/1/file/Macellum_at_Pompeii.pdf

The models are viewable in Windows and OSX but I can't find any way to view them in Ubuntu.

I've tried evince but it doesn't work.

Acroread

If you can't get it in software center, Check https://get.adobe.com/uk/reader/otherversions/ . Download .deb package.

Adobe dropped Linux support, but still possible to find it here:

ftp://ftp.adobe.com/pub/adobe/reader/unix/
http://archive.canonical.com/pool/partner/a/acroread/ (repackaged)

This pdf file seems working just fine to me :
Try using Foxit reader,
To install it : sudo apt-get install foxitreader
or visit this wiki article about it : Here


No sound on ASUS 1225C notebook with pre-installed 12.04 LTS Sound works fine on first operation. However, after doing a complete update sound is lost. Solutions presented on Ask Ubuntu up to now do NOT work. Only solution for the moment is to return to factory settings losing all personal files and downloaded updates. This "NO SOUND" problem seems to be major. Any ideas anyone ? Your help would be much appreciated by thousands of users world-wide !

Same problem here. Following the advice given in lindis comment doesn't help at all: alsa-hda-dkms isn't present.

Here how I get it to work: I removed dkms ( apt-get remove dkms ).Then I've rebooted (graphics are disabled, it's text only mode); I've reinstalled dkms ( apt-get update ;apt-get install dkms) then started X (startx); from there I reinstalled the proprietary driver using the driver utility (I don't know how to run it from the command line though I suppose there's some CLI utility to achieve the same result).

After another reboot both sound and graphics work properly.

My reference (lindis) was the post n.17 of the site  https://bugs.launchpad.net/ubuntu/+source/alsa-driver/+bug/1037763.


Unable to load kernel module I've clean install ubuntu 15.04 and updated all required packages for installing:-

  LINUX X64 (AMD64/EM64T) DISPLAY DRIVER
  Version:  346.87
  Release Date: 2015.7.21
  Operating System: Linux 64-bit

And enable multi architecture support for installing nvidia 32-bit library

sudo -i
cd /etc/apt/sources.list.d
echo "deb http://old-releases.ubuntu.com/ubuntu/ raring main restricted universe multiverse" >ia32-libs-raring.list
apt-get update
apt-get install ia32-libs

After which i've installed packages

sudo apt-get install linux-source linux-headers-$(uname -r)
sudo apt-get install build-essential dkms
To delete all the nouveau driver
sudo apt-get --purge remove xserver-xorg-video-nouveau
Blacklisted nouveau driver in modprobe.d as sudo gedit /etc/modprobe.d/nvidia-346_updates.conf
And inserted :-

#Necessary to install nvidia drivers
blacklist nouveau
blacklist lbm-nouveau
blacklist nvidia-173
blacklist nvidia-96
blacklist nvidia-current
blacklist nvidia-173-updates
blacklist nvidia-96-updates
alias nvidia nvidia_current_updates
alias nouveau off
alias lbm-nouveau off
options nouveau modeset=0

sudo update-initramfs -u
And rebooted go in grub menu and set "nomodeset"
login in text mode and stoped lightdm service by sudo service lightdm stop
sudo chmod +x NVIDIA-Linux-x86_64-346.82.run
sudo ./NVIDIA-Linux-x86_64-346.82.run --no-opengl-files

The installer exit by giving error that unable to load kernel module
Can anyone please help me describing why this error is occurring and why i am unable to install it and also how to set-up external monitor where the HDMI port is connected to NVIDIA card The external monitor connected using HDMI to DVI cable.
As i also want to get proper instruction manual for setting this type of setup. Thnxxxx in advance.

The NVidia driver version 346 is available as an Ubuntu package.

apt-get install nvidia-346

should get you going.


14.04 - cannot click inside windows I have Asus k53sv, Ubuntu 13.04 and 13.10 were working without problems.
Now I upgraded to 14.04.

Upper panel works, so I can connect into WiFi or shutdown machine. I can also launch application from left launch bar.
But most applications are not responding to mouse clicks:

Folders: I can not open any folder. I see my home folder, but application is not responding to clicking.
system preferences: the same as above, not responding to clicking.
terminal: can type, but no response to clicking.
In any application 'red x' is not closing application, to shut it down I have to right-click on launch bar and select 'Quit' option.

For a while of using system (Chrome is working normally, so it is not mouse problem) I cannot even launch application from launch bar.
I tried to boot with older kernel (from grub options) but result is the same.

Any ideas how to fix it? I can do some debug work if you tell me what to do.
I would like to do not re-install whole system from scratch, I have installed and configured some applications (Eclipse, Kile) I and do not want to configure them again.

Problem solved, my Madcatz RAT 3 mouse was causing this strange behaviour, solved as shown in this video

First, identify the device by running

xinput -list

In the section Virtual Core Pointer identify the exact name of the mouse. In my case, it's

Madcatz Mad Catz R.A.T.3

copy that name, and then make an in entry in /etc/X11/xorg.conf...

sudo -i
gedit /etc/X11/xorg.conf

Now enter this, using the device name from xinput -list in the MatchProduct line

Section "InputClass"
Identifiers "Mouse Remap"
MatchProduct "Madcats Mad Catz R.A.T.3"
MatchDevicePath "/dev/input/event*"
Option "ButtonMapping" "1 2 3 4 5 0 0 8 9 0 0 0 0 0"
EndSection

Save the file, close it and enter exit in the terminal to drop privileges. After reboot, the mouse works fine.

Try switching off the your computer and switching it on. It worked for me.


Microphone is not working in Skype I am using Ubuntu 12.04 and Skype.

My mic is not working. I have 1 mic attached to the system and another one in my headphone (Beats by Dr. Dre).

I followed these steps:

Turn PulseAudio autospawn off, normally: $ echo "autospawn = no" > ~/.pulse/client.conf

killall pulseaudio

But this did not help me and it disabled my sound after my system restarted. I then tried

echo "autospawn = yes" > ~/.pulse/client.conf

then

pulseaudio -D

It fixed my system sound but still no sound on Skype microphone.

After that, I tried this command

echo "options snd-hda-intel model=acer" | sudo tee -a /etc/modprobe.d/alsa-base.conf > /dev/null

I've also upgraded alsa sound drivers by running:

sudo add-apt-repository ppa:ubuntu-audio-dev/ppa
sudo apt-get update
sudo apt-get install linux-alsa-driver-modules-$(uname -r)

however on the last command:

sudo apt-get install linux-alsa-driver-modules-$(uname -r)
[sudo] password for gaurav:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package linux-alsa-driver-modules-3.2.0-27-generic-pae
E: Couldn't find any package by regex 'linux-alsa-driver-modules-3.2.0-27-generic-pae'

When I type pulseaudio in terminal it shows me

E: [pulseaudio] pid.c: Daemon already running.
E: [pulseaudio] main.c: pa_pid_file_create() failed.

After all this, my sound system started behaving abnormally. Internal Speakers and headphone or 5.1 speakers both works at same time but still the microphone is not working. I even hear a noise when I don't play anything. It's freaking me out and my microphone problem is after 12.04 . Can I use my headphone microphone? I am having beats headphones.

Details of my system alsamixer

Even Now My system sound  OUTPUT connector option is gone  here is the screen shot

My solution

I think that the problem lies within a non-intuitive way of adjusting the recording settings.

Within skype, do the following:

Open options dialog.
Go to Sound Devices.
Click on 'Open PulseAudio Volume Control'.

Here comes the non-intuitive part!!!

Under the 'Recording' tab...

If no program is recording anything (being in idle mode) it shows nothing
at all. One might think that there is nothing to this tab of interest, but
one would be mistaken!!! Keep this tab open and visible. Make sure the 'Show'
option at the bottom is set to either 'All Streams' or 'Applications'.

Start a test call from the options dialog.

The pulseaudio dialog will now show what program is recording sound from where.

Skype: Input from...

To the right of this text, select your input device and it should finally work.

It took me a while to figure this one out.

Скачай и установи gnome alsa mixer и тогда микрофон заработает нормально

Translation:

  Download and install gnome alsa mixer and then the microphone will function normally


How do I check which shell I am using? I read that terminal is nothing but shell, and Unix provides different flavors of shells:

Bourne shell (sh)
C shell (csh)
TC shell (tcsh)
Korn shell (ksh)
Bourne Again shell (bash)

Questions:

When I open a terminal window, which shell is opened by default?
How do I check how many shells are installed?
How do I change the shell used from my account?

You can type the following command in your terminal to see which shell you are using:

echo $0

The result will look something similar to the below if you are using the bash (Bourne Again Shell) terminal:

-bash

In one of the servers I connect to, the login shell is /bin/sh which is a symlink to /bin/bash

Most answers here will give sh, which would make the OP consider it's Bourne shell and not GNU bash, except this one that gives /bin/bash

Another option that works for this case is:

$ echo $SHELL
/bin/sh

$ ls -l /bin/sh
lrwxrwxrwx 1 root root 4 May 31 16:15 /bin/sh -> bash

$ /bin/sh --help
GNU bash, version 4.2.10(1)
Usage:  /bin/sh [GNU long option] [option] ...
        /bin/sh [GNU long option] [option] script-file ...


How to get userID when writing Linux kernel module Here is my function in my kernel module which I insert using insmod command after make at later stages. I am working on  goldfish (2.6.29)

asmlinkage long our_sys_read(unsigned int fd, char  *buf, size_t count)
{
      printk("------->> our_sys_read getuid() ---------- %d\n", getuid());

      return original_call_read(fd,buf,count);
}

I want to trap system calls and find out which user made these system calls. But when I run 'make', it throws me following error.

/home/mohsin/LKM/trapcall.c:245: error: implicit declaration of function 'getuid'

Any suggestion would be appreciated.

Use get_current_user()->uid; instead of get.


File browser: Get total duration of selected audio/video files I would like to know how I can know the total duration of selected audio/video files in one of the Linux file managers, if it's possible.

I use Ubuntu 18.04 LTS, and its default file manager is Files AKA Nautilus.

Here is a Nautilus Script
 - Select files in nautilus
 - Right-click on it
 - In context menu, select Script > NameOfScript

Installation:
Install the mediainfo program if not present sudo apt install mediainfo
Save the script to a file in ~/.local/share/nautilus/scripts
Make it executable chmod +x ~/.local/share/nautilus/scripts/scriptname
Visit the scripts directory once with nautilus nautilus ~/.local/share/nautilus/scripts

#!/bin/bash

# Selected fileslist to Array
OLDIFS=$IFS
IFS=$'\n'
fileArray=($NAUTILUS_SCRIPT_SELECTED_FILE_PATHS)
IFS=$OLDIFS

# Length of array: total num of selected files
NbFiles=${#fileArray[@]}

# The loop
for (( i=0; i < ${NbFiles}; i++ ));
do
    # Get duration if file is media (audio or video)
    buff=$(file -N -i "${fileArray[$i]}" | grep -E 'audio|video')
    if [ ! -z  "$buff" ]
        then
            # mediainfo gives duration in milliseconds, easy to sum up
            MediaDuration=$(mediainfo --Output='General;%Duration%' "${fileArray[$i]}")
            TotalDuration=$((TotalDuration + MediaDuration))
            NbMedia=$((NbMedia + 1))
    fi
done

# Format Duration: milliseconds to H:M:S
Seconds=$((TotalDuration / 1000))
FormattedDuration=$(printf '%02dh:%02dm:%02ds\n' $(($Seconds/3600)) $(($Seconds%3600/60)) $(($Seconds%60)))

# Build report
ReportText="${NbFiles} File"
test $NbFiles -gt 1 && ReportText="${ReportText}s"
ReportText="${ReportText} selected\n"
test $NbMedia -gt 0 && ReportText="${ReportText}${NbMedia} media file" || ReportText="${ReportText}No media file"
test $NbMedia -gt 1 && ReportText="${ReportText}s"
test $NbMedia -gt 0 && ReportText="${ReportText}\nTotal duration: ${FormattedDuration}"

zenity  --info --no-wrap --text="${ReportText}"

Nice script,
Im new with coding and ijust replaced some of the code
Thank you a lot
#!/bin/bash

# Selected fileslist to Array
IFS=$'\n'
fileArray=($(find $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS -type f | grep -iE "\.webm$|\.flv$|\.vob$|\.ogg$|\.ogv$|\.drc$|\.gifv$|\.mng$|\.avi$|\.mov$|\.qt$|\.wmv$|\.yuv$|\.rm$|\.rmvb$|/.asf$|\.amv$|\.mp4$|\.m4v$|\.mp4$|\.m?v$|\.svi$|\.3gp$|\.flv$|\.f4v$"))
audioArray=($(find $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS -type f | grep -iE "\.pcm$|\.raw$|\.wav$|\.aif$|\.aiff$|\.aifc$|\.caf$|\.au$|\.snd$|\.mp3$|\.m4a$|\.m4b$|\.m4p$|\.m4v$|\.m4r$|\.aac$|\.wma$|\.ogg$|\.oga$|\.flac$"))
# Length of array: total num of selected files
Nbfiles=-1
audioFiles=-1
NbFiles=${#fileArray[@]}
audioFiles=${#audioArray[@]}

# The loop audio and video

for (( i=0; i < ${NbFiles}; i++ ));

do
    # mediainfo gives duration in milliseconds, easy to sum up
    MediaDuration=$(mediainfo --Output='General;%Duration%' "${fileArray[$i]}")
    TotalDuration=$((TotalDuration + MediaDuration))
    NbMedia=$((NbMedia + 1))
done

for (( i=0; i < ${audioFiles}; i++ ));
do
    # mediainfo gives duration in milliAudioSeconds, easy to sum up
    AudioMediaDuration=$(mediainfo --Output='General;%Duration%' "${audioArray[$i]}")
    AudioTotalDuration=$((AudioTotalDuration + AudioMediaDuration))
    audioMedia=$((audioMedia + 1))

done

# Format Duration: milliseconds to H:M:S
Seconds=$((TotalDuration / 1000))
FormattedDuration=$(printf '%02dh:%02dm:%02ds\n' $(($Seconds/3600)) $(($Seconds%3600/60)) $(($Seconds%60)))
# Format Duration: milliAudioSeconds to H:M:S
AudioSeconds=$((AudioTotalDuration / 1000))
AudioFormattedDuration=$(printf '%02dh:%02dm:%02ds\n' $(($AudioSeconds/3600)) $(($AudioSeconds%3600/60)) $(($AudioSeconds%60)))

# Video report
if [ $NbFiles -gt 0 ]
then
    if [ $NbMedia -gt 0 ]
        then
        ReportText="\n Video \n \n${ReportText}${NbMedia} Video file" || ReportText="${ReportText}No Video file"
    fi
    if [ $NbMedia -gt 1 ]
        then
        ReportText="${ReportText}s"
    fi
    if [ $NbMedia -gt 0 ]
        then
        ReportText="${ReportText}\nTotal Video duration: ${FormattedDuration}"
    fi
fi
# Audio report
if [ $audioFiles -gt 0 ]
then
    if [ $audioMedia -gt 0 ]
        then
        AudioReportText="\n\nAudio \n \n${AudioReportText}${audioMedia} Audio file"
        else
        AudioReportText="${AudioReportText}No Audio file"
    fi
    if [ $audioMedia -gt 1 ]
        then AudioReportText="${AudioReportText}s"
    fi
    if [ $audioMedia -gt 0 ]
        then
        AudioReportText="${AudioReportText}\nTotal Audio duration: ${AudioFormattedDuration}"
    fi
fi
#Total time of audio and video
if [ $NbFiles -gt 0 ] && [ $audioFiles -gt 0 ]
    then
    totalfiles=$((NbMedia +  audioMedia))
    TotalSeconds=$((Seconds +  AudioSeconds))
    TotalFormattedDuration=$(printf '%02dh:%02dm:%02ds\n' $(($TotalSeconds/3600)) $(($TotalSeconds%3600/60)) $(($TotalSeconds%60)))
    TotalReportText="\n \n Total Files: ${totalfiles}\n Total Time:${TotalFormattedDuration}"
fi
#if no file is found print text or else print everything
if [ $NbFiles -eq 0 ] && [ $audioFiles -eq 0 ]
    then
    ReportText="No Media Found"
    zenity  --info --no-wrap --text="${ReportText} ${AudioReportText}"
    else
    # Format Duration: milliseconds to H:M:S
    zenity  --info --no-wrap --text="${ReportText} ${AudioReportText} ${TotalReportText}"
fi


What do the various dpkg flags like 'ii' 'rc' mean? I frequently need to check which packages are installed, and I use the following command:

dpkg -l | grep foo

which gives the following output

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Cfg-files/Unpacked/Failed-cfg/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)
||/ Name                       Version         Description
ii   foo                       <version>         <description>

What does the ii mean?
What other flags are there?
How to read the flags? (because the explanation is quite complicated, IMO)

Thanks.

Where to find this information in the system

You can find this information out in the head of dpkg -l output, as it's just a formatting convention:

dpkg -l | head -3

Copied here for reference:

Desired=Unknown/Install/Remove/Purge/Hold
| Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend
|/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad)

Description of each field

As you can see from the first three lines:

First letter -> desired package state ("selection state"):

u ... unknown
i ... install
r ... remove/deinstall
p ... purge (remove including config files)
h ... hold

Second letter ->  current package state:

n ... not-installed
i ... installed
c ... config-files (only the config files are installed)
U ... unpacked
F ... half-configured (configuration failed for some reason)
h ... half-installed (installation failed for some reason)
W ... triggers-awaited (package is waiting for a trigger from another package)
t ... triggers-pending (package has been triggered)

Third letter -> error state (you normally shouldn't see a third letter, but a space, instead):

R ...  reinst-required (package broken, reinstallation required)

It means that the package is desired to be installed and that the package is installed.
See man dpkg-query
Upper case letters shown in the alternatives after equals sign in the three first lines in the legend are the letters possibly shown shown as the first three characters in the first field, respectively, but not all of them in the same case i.e some of the letters are shown in lower case. The third character is space normally.


How can I install GNOME or GTK+ 3.6 on Ubuntu 12.04? Is it possible to install GNOME 3.6 or gtk+ 3.6 on Ubuntu 12.04? If yes, how?

I want to write an application which uses GtkMenuButton.

GtkMenuButton is a new widget introduced in GTK+ 3.6.

It's not possible. Even when adding the GNOME 3-team PPA, the highest you get is 3.4.2. Only 12.10 and 13.04 (possibly 13.10: may already have GNOME 3.8) can run 3.6 and higher.


How to install Epson WF2010 on Ubuntu 14.0 I am not an expert on Ubuntu but has been using it for the last 3 years.
I recently bought an Epson printer WF2010. On installing it the printer is recognised by the computer but on printing it prints rubbish!
On contacting Epson they sent me the following instructions:

and the following if using a 64 bit system:

epson-inkjet-printer-201211w_1.0.0-1lsb3.2_amd64.deb

Along with the following file regardless of system type:

epson-inkjet-printer-201211w-1.0.0-1lsb3.2.x86_64.rpm

I installed epson-inkjet-printer-201211w_1 through the software centre. But, cannot open it!
Not sure what to do with the file: epson-inkjet-printer-201211w_1.0.0-1lsb3.2_amd64.deb

Please help!!!!

The epson-inkjet-printer-201211w-1.0.0-1lsb3.2.x86_64.rpm file is going to be used for rpm-based distributions. If you can't install the .deb file through the Software Center, you can always attempt to install it via the command line using the dpkg package manager. Try running sudo dpkg -i epson-inkjet-printer-201211w_1.0.0-1lsb3.2_amd64.deb in the directory where the file is located.

I downloaded the applicable driver from epson 'epson-inkjet-printer-201211w_1.0.0-1lsb3.2_amd64.deb'.
Then I double clicked on the file and the installation started.
Then it asked for a mount of the Ubuntu installation disk in '/media/cdrom'.
I inserted the installation disk but unfortunately  it automounted to '/media/mycomputer/UBUNTU-disk-name'.
Therefore I opened the terminal and input after the'$ ' prompt:
sudo mount -B '/media/CCC/Ubuntu 14.04 LTS amd64' '/media/cdrom'
To do so, please replace CCC with your computer name and 'Ubuntu 14.04 LTS amd64' with the name of your installation disk,
After this I continued the installation procedure but the installation failed.
Then I double clicked again the file: 'epson-inkjet-printer-201211w_1.0.0-1lsb3.2_amd64.deb' but with the cdrom already mounted from the attempt before.
After this the installation ran perfectly, so I've also installed a driver to happiness with my printer to myself.


Install deluge daemon through apt-get only? Okay so here is where I'm at, I have already run this:

sudo apt-get install deluged deluge-webui

and when I typed in deluged it starting running the dameon

I guess my question is where do I go from here? How do I get the web-ui running and how can I make sure they all start when the entire server is restarted?

You also need to start deluge-web. Or deluge-web --fork if you want the process to be started in the background. Then open a browser.

Go to http://localhost:8112

Password should be deluge.

If you want it started at boot time you need to folllow this.

Check this easy to follow guide for Deluge installation:

http://linuxblog.avserver.info/install-deluge-with-webui-on-ubuntu-1204-precise-pangolin-server/

Worked for me on Ubuntu Server 12.04 Precise.


How to compile a .java file on Ubuntu? How can I compile a .java file?

What programs will I need? If I need the Java JDK I will also need help installing that. I'm very new to Ubuntu, so any program that I need to install I will need a tutorial on how to install them.

To compile the file, open your terminal and type

javac filename.java

To run the generated class file, use

java filename

But to do this you need to have the Java JDK installed in your computer. You can install it with the instructions in How do I install Java?.

Just type sudo apt-get update, followed by sudo apt-get install openjdk-7-jdk for a quick installation for java7, then you can play games with java :-)

For more detailed official Java documentation, please visit this link.


When removing Ubuntu for windows should I delete all partitions? I'm about to install Windows 10 from a usb. Currently the only operating system on my computer is Ubuntu. I want to remove Ubuntu for windows 10 and probably create a dual boot at a later time.

When I am in the installer Page for windows 10 regarding portions should I delete all of the partitions for the drive I am installing to? In this case it is the SSD that Ubuntu is currently installed on.

There are 3 partitions. One 215gb, one 512mb and one 7.9gb. The drive is meant to be 240gb.

You will want to remove all partitions from the install disk, yes. Windows will create its own partition (or two, depending if it wants a D: drive). When installing Ubuntu later, you will recreate 2 more partitions.

Beware that you will lose ALL data on the Ubuntu partitions. Make sure you've saved your documents, pictures, videos, etc. before doing this.


How to temporarily disable PulseAudio? Just wondering if there a way to temporarily disable PulseAudio as I am trying to run a specific Wine game (Left 4 Dead 2) and it makes the game crash occasionally.

If I kill the process it automatically comes back up. Any suggestions?

You can use pasuspender. Try prefixing your wine command with it.

pasuspender -- wine path/to/file.exe

What I did.... stopped it from respawning because it couldn't find it....... right click the /etc folder in the file browser (open as root) create a new folder called pulseoff, then move the pulse folder into it (drag and drop). The system doesn't have the command to look there for it. If you want to start it again, cut it from the pulseoff folder, go up a step to the /etc folder and paste it there...... Some people like to make it out to be harder than it really is with editing files and stuff and mostly those edits don't work I tried them. Do it the easy way. I restarted the machine and checked the system monitor before posting this, pulseaudio is not running and sucking up memory.


How can I assign space from a logical partition to a primary one (to resize the primary) I have the following situation:

.

I want to resize the ntfs partition. Specifically I want to add  it 15 GB.
What is the best sequence of steps to do?

The output from sudo fdisk -l /dev/sda and sudo fdisk -l /dev/sdb

Make sure your backups of documents and other important files are current. You might make a mistake, or data loss could occur during dynamic partition resizing. Once that's done,  boot from an Ubuntu live CD/DVD/USB, select Try Ubuntu, and run the GParted Partition Editor.
Taking space from /dev/sda7 is the easiest, as it requires a lower number of resize/move operations than taking it from /dev/sda5. This, in turn, is because your /dev/sda7 partition is closer to the beginning (left) boundary of /dev/sda2 (the extended partition container), and that boundary has to be moved.

Right-click on /dev/sda7 (your Ubuntu partition, /) and click Resize/Move. Shrink it from the left--that is, increase the Free space preceding.
Decrease it by however much you want your Windows partition to increase. Please note that you won't necessarily be able to increase your Windows partition by exactly that amount (depending on alignment issues), but it will be pretty close.
Now there is space between /dev/sda6 and /dev/sda7.

Right-click on /dev/sda6 (your linux-swap partition) and click Resize/Move. Slide it as far to the right as possible, so it is once again flush against /dev/sda7 (or as close as it can be).
Now there is unallocated space at the very beginning of the extended partition.

Right-click on /dev/sda2 (the extended partition). It's much easier to select this form the list than from the horizontal bar representing your disk. Click Resize/Move. Shrink it from the left--that is, increase the Free space preceding.
Now there is unallocated space outside the extended partition, immediately to the right of the Windows partition.

This is the moment you've been waiting for. Expand the Windows partition (/dev/sda1) to fill that space: Right-click on it, click Reize/Move, and expand it on the right--that is, decrease the Free space following.

Click the check mark to apply your changes, and hope everything works out OK. When that's done, quit GParted.

You won't necessarily have to reinstall Ubuntu's GRUB2 boot loader to the Master Boot Record, but you might as well, as long as you're already booted into the live environment. (Otherwise, you might have to boot back to the live CD/DVD/USB to do it, after discovering that GRUB is not working well enough to boot Ubuntu...or to boot anything.)
Open a Terminal window (Ctrl+Alt+T) and run these commands to reinstall GRUB2 to the MBR (it's this technique, but with the correct values for your system filled in):
sudo mount /dev/sda7 /mnt    # For other folks: Replace sda7 with your / device.
sudo grub-install --root-directory=/mnt /dev/sda
sudo umount /mnt

It's theoretically possible that your Windows system will also need to be repaired, but very unlikely, because:

GRUB2 takes care of bootstrapping to the Windows boot loader (which is in the boot sector of its partition, not in the MBR). That's still present and fully intact.
That's the real reason the Windows system will almost certainly be fine. Read on, if secondary factors interest you...

The Windows partition still begins in the same place on the disk.

The Windows partition was just expanded to the right, so all its files are in the same place on the disk.

Some Windows 7 systems have separate partitions for the boot loader (similar to, but not quite the same as, a /boot partition on some Ubuntu and other Unix-like systems). Yours does not. So there's nothing external to sda1 that matters, when it comes to whether or not the Windows system works. GRUB2 passes control to the boot loader in sda1, and from there on everything is in the same place it was before.

In the event that your Windows system did stop booting and you had to repair it, you could do it from the recovery console on a Windows install DVD/USB, including a trial DVD/USB.
But you probably don't need to resize your partitions at all.
Now that I've presented detailed instructions for resizing your partitions, I'd like to suggest an alternative.
I'm guessing you want to expand your Windows primary partition because you need to fit more into folders that are supposed to be located on that partition and not some other partition.
However, you have another NTFS partition (a logical partition, in the extended partition, to the right of Ubuntu's partitions) with plenty of free space.
So you can make NTFS junctions in your small-ish Windows partition, with their target folders in the big-ish logical NTFS partiton.
For example, a folder from inside Program Files (or even Program Files itself!) could be moved off to the bigger NTFS partition, and a junction created in its place, pointing to it on the big partition.
Or take a look at "How to create and manipulate NTFS junction points," which explains how to use the linkd and delrp commands to create and destroy junctions. Or you may prefer the junction command, which you can get here. (Windows 7 also supports another kind of symbolic link, see this article and mklink.)
NTFS directory junctions are a lot like symbolic links in ext4 and other Unix-style filesystems. But be careful! Directory junctions are parsed like directories, even in situations where *nix symlinks would be parsed like files. For example:

Deleting a junction, the way you'd delete a file or folder, deletes what it points to. (Or at least deletes the contents of what it points to.)
If a directory C:\foo contains a directory qux, which contains a junction bar pointing to D:\baz, and you recursively delete foo or qux (for example, by Shift+Deleteing the folder in Windows Explorer), D:\baz and everything contained within it gets deleted.
Moving C:\foo\qux to C:\ (so it will be C:\qux) moves D:\baz and everything in it from D: to C:!

NTFS junctions don't cause problems in Ubuntu. NTFS-3G, Ubuntu's NTFS filesystem driver, is compatible with them (though they're treated like Unix-style symbolic links, which means they behave a bit differently than on Windows).
For details or advice on creating and managing junctions (or other forms of symbolic links, as were added in Windows 7) within Windows, you should ask somewhere Windows is supported, such as Super User. (And, at least in my opinion, you should use Windows to make them if you decide to use them, even if it's theoretically possible to do so in Ubuntu.) But I wanted to present what may be a good alternative to resizing your partitions.

DISCLAIMER

before proceeding, be prepared to have an unbootable system. Get a Knoppix, a Win7 recovery disk and someone that knows how to recover from a broken Grub2/Win7 bootloader.

Ok, here is what should be the simplest solution. Resize /dev/sda5 to be close to 165Gb. You'll end up with a free 30Gb partition at the end of the disk. There you can copy your primary NTFS partition (/dev/sda1) and resize it to fill the empty space.

When gparted has finished, hide the first partition (/dev/sda1) and update the grub2 configuration immediately (sudo update-grub).

Win7 shouldn't have problems in booting from a logical partition at the end of the disk if grub2 does it work properly. However Win7 is unpredictable by definition, so be prepared.

Good luck!


Supr, and 3 arrows keys not working in Ubuntu 12.04 Well, my arrows (up, left, down) and my supr(or del) key are not working..
I tried with
sudo dpkg-reconfigure keyboard-configuration
with a few different keybords, and changing System Settings about the keyboard but nothing happens. I keep getting this image with and X every time I use these keys(in chrome, firefox, terminal, etc).
The arrows are working well with "Fn". And they were working yesterday as arrows.

I'll suggest you not to randomly select the keyboard model. Select the one that match to your machine.
e.g. I am using Acer Aspire E1-410, so I have to select Acer Laptop as the keyboard model.


Unable to open Few .jar files in Ubuntu 15.04, Error: "Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar " I got stuck with this, I can't able to open few .jar files. Its throwing error as:

Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar

Please check the screenshot(1 pic is of BurpLoader.jar unable to open, 1 one is burpsuite n was able to open it)

Have you try using 7zip, and type this in the terminal:

First install 7zip an unrar:

 sudo apt-get install 7zip unrar

and then type this in the terminal:

 unzip (file to extract) -d (path)


12.04 - Problem with Update Manager When opening up Update Manager, I get the following message -

Could not initialize the package information

E:Type 'b-src' is not a known on line 2 in source list /etc/apt/sources.list.d/whatsapp-purple-ppa-precise.list,

E:The list of sources could not be read, E:The package lists or status file could not be parsed or opened.

Please help.

Output for ls /etc/apt/sources.list.d/

cdemu-ppa-precise.list.bak
cdemu-ppa-precise.list.save
getdeb.list
getdeb.list.save
google-chrome.list
google-chrome.list.save
kalakris-okular-precise.list
kalakris-okular-precise.list.save
kubuntu-ppa-backports-precise.list
kubuntu-ppa-backports-precise.list.save
linrunner-tlp-precise.list
linrunner-tlp-precise.list.save
nilarimogard-webupd8-precise.list
nilarimogard-webupd8-precise.list.save
nvbn-rm-ppa-precise.list
nvbn-rm-ppa-precise.list.save
opera.list
opera.list.save
precise-dell.list
precise-dell.list.save
private-ppa.launchpad.net_commercial-ppa-uploaders_fragment_ubuntu.list
private-ppa.launchpad.net_commercial-ppa-uploaders_fragment_ubuntu.list.save
private-ppa.launchpad.net_commercial-ppa-uploaders_steam_ubuntu.list
private-ppa.launchpad.net_commercial-ppa-uploaders_steam_ubuntu.list.save
scopes-packagers-ppa-precise.list
scopes-packagers-ppa-precise.list.save
skunk-pepper-flash-precise.list
skunk-pepper-flash-precise.list.save
springseed.list
springseed.list.save
steam.list
steam.list.save
teejee2008-ppa-precise.list
teejee2008-ppa-precise.list.save
ubuntu-extras.list
ubuntu-extras.list.save
ubuntu-wine-ppa-precise.list
ubuntu-wine-ppa-precise.list.save
videolan-stable-daily-precise.list
videolan-stable-daily-precise.list.save
webupd8team-jupiter-precise.list
webupd8team-jupiter-precise.list.save
webupd8team-tor-browser-precise.list
webupd8team-tor-browser-precise.list.save
webupd8team-y-ppa-manager-precise.list
webupd8team-y-ppa-manager-precise.list.save
whatsapp-purple-ppa-precise.list
whatsapp-purple-ppa-precise.list.save

The problem in whatsapp purleppa, Remove it and you'll be alright.

sudo rm -r /etc/apt/sources.list.d/whatsapp-purple-ppa-precise.list
sudo rm -r /etc/apt/sources.list.d/whatsapp-purple-ppa-precise.list.save

Then run:

sudo apt-get update

You could try this enter in the terminal:

rm -r /etc/atp/sources.d /etc/atp/sources.list

and it might work fine this way.


How can I capture network traffic of a single process? I would like to examine the network traffic being handled by a single process, but simple network captures won't work since I am dealing with such a busy system (lots of other traffic happening at the same time). Is there a way to isolate a tcpdump or wireshark capture to the networking traffic of a single specific process? (Using netstat is insufficient.)

To start and monitor an new process:

strace -f -e trace=network -s 10000 PROCESS ARGUMENTS

To monitor an existing process with a known PID:

strace -p $PID -f -e trace=network -s 10000

-f is for "follow new processes"
-e defines a filter
-s sets the limit of strings to more then 32
-p takes the process id to attach to

I think you can create a shell script to loop through executing netstat and logging it to a text file. Something like (very rough steps):

echo "press q to quit"
while [ <q is not pressed>]
do
    `netstat -taucp | grep <pid or process name> 1>>logfile.txt`
done

I am not a programmer, so I can't refine this. But someone here can start from where I left off and create a working script for you.


What's the best way to pause my work in Virtualbox with Ubuntu as a guest? Host OS: Windows 7 Guest OS: Ubuntu 11.04

Say if I won't need to work on the guest OS for 1 hour, while having a lot of programs running and don't want to close them. What is the best way to pause my work on the guest OS? Ubuntu has suspend and hibernate. I found that hibernate won't work as it always fails to boot up after hibernate. For suspend, should I couple it with Virtualbox pause to release the host OS resources. Would this cause any issue once resume the work? Since I found sometimes the guest OS becomes slower resume from pause VM.

For Virtual Box it is not recommended to use the power saving features of the guest OS as this will all be handled by the host. Therefore first thing when having installed my guest OS I disable this (including disabling the screen saver).

The appropriate way to save a virtual machines state (and resume later) is to coose Save the machine state when closing the machine from virtual box manager (here depicted for Windows XP).

This will free all ressources from the virtual machine. Next time we start the machine we will resume exactly at the same state where we saved it (like in suspend/hibernate from a real machine).

From command line this can also be done by

VBoxManage controlvm <name_of_machine>  savestate

Note on security: Mind that resuming from a saved state does not ask for authentication for the guest OS. In case we work with confidential data we therefore need to log out (or switch user) from the guest OS before saving.

Did you install Vbox additions correctly on the guest OS?

I don't see a problem with of the options here. If you can make Ubuntu hibernate it would be great but a suspend + pause option will work the same.

Hibernation can be simply described as: all content in memory save in disk file which is read again on boot up. (Memory>temp file in disk>power off:::power on>read temp file to memory> restore session>read new times, dates of other hardware info that might have changed in the meanwhile>ready)

Suspend can be simply described as: all content of memory will not be touched, most of your hardware will be powered down, once you start up again the memory session will be restored. (memory stays the same, static>most hardware powers off, memory is not turned off:::power back on>restore session>read new times, dates of other hardware info that might have changed in the meanwhile>ready)

So, in the end, its the same if you hibernate or suspend + pause you guest OS. The results should be the same.

Work on the hibernation part in my opinion, saves an extra "pause" click.


SolidWorks on Ubuntu 13.04? I am a Bioengineering student who works with SolidWorks and I would like to be able to run it on Ubuntu 13.04. Short of having to install Windows, what methods are available and which works best?

If I were to use Virtualization and install Windows on a Virtual machine, is there anyway I can optimize graphic performance among other things? Is Wine a viable option for high intensity use?

Since everyone else in the department uses SolidWorks, I don't want to veer off and use unfamiliar software.

Wine is a useful tool for running Windows applications however I wouldn't recommend it for graphics intensive programs (games, CAD, etc.) as these can create many bugs in Wine.

I think you would be better off with VMWare Player or VirtualBox which both allow you to run a virtual Windows OS inside Ubuntu.

To optimize your VM, see http://www.howtogeek.com/124796/the-htg-guide-to-speeding-up-your-virtual-machines/

For 3D Cads you have no choice, you have to install Windows.. I have the same problem. Unless you use less sophisticated cads for linux like Medusa amongst other. But Solidworks is the best, so just make a dual boot pc with Windows and Ubuntu. Use Windows for 3D Cad and Ubuntu for all other applications. You can always run Ubuntu from within Windows using a virtual machine (e.g. VirtualBox) that points to Ubuntu physical partition on your disk, so that when you use it in a virtualized environment you are actually making modifications you'll find when booting the machine with Ubuntu.


Ubuntu Server 14.04 (Bridged VM) Cant connect to network I installed an ubuntu server 14.04 on a bridged VMWare VM:

During the installation it tried to auto-configure the network settings but it failed, so I configured it manually:

(Its in my home network (NAT))

Its a home network and my router's ip is 10.0.0.138 (gateway)
subnet mask is 255.255.255.0.

I gave the server VM the static ip 10.0.0.111, while my computer is 10.0.0.200.

There's no ping to the computer, nor the gateway (unreachable dest.).

If there are any more details I can give, please let me know.

VM:

Computer:

It seems as if I configured everything right, but for some reason it doesn't seem to work.

I've tried this tutorial and more tutorials, but I haven't managed to successfully connect it..

I had to flush VMware network adapters configurations..

See this video for flushing Vmware network adapters and setting your Vmnet0 interface for autobridging with your Physical network adapter.

https://www.youtube.com/watch?v=bFlmyuNzCVA

For me it works!


My ethernet is not been detected in Ubuntu 12.04 I'm very new to Ubuntu, all of a sudden my internet is not working in my Ubuntu machine.
But fortunately the internet is working in my Windows machine. The ethernet cable is not even gets detected in my Ubuntu machine.
As a new user to Ubuntu, this is really frustrating. Are there any ways to use internet in Ubuntu?
Edit:
Doing ifconfig eth0:
eth0      Link encap:Ethernet  HWaddr 6c:f0:49:c4:7f:2d
          UP BROADCAST MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)
          Interrupt:42

Doing lspci , gives me :
00:00.0 Host bridge: Intel Corporation 4 Series Chipset DRAM Controller (rev 03)
00:02.0 VGA compatible controller: Intel Corporation 4 Series Chipset Integrated Graphics Controller (rev 03)
00:1b.0 Audio device: Intel Corporation N10/ICH 7 Family High Definition Audio Controller (rev 01)
00:1c.0 PCI bridge: Intel Corporation N10/ICH 7 Family PCI Express Port 1 (rev 01)
00:1c.1 PCI bridge: Intel Corporation N10/ICH 7 Family PCI Express Port 2 (rev 01)
00:1d.0 USB controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #1 (rev 01)
00:1d.1 USB controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #2 (rev 01)
00:1d.2 USB controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #3 (rev 01)
00:1d.3 USB controller: Intel Corporation N10/ICH 7 Family USB UHCI Controller #4 (rev 01)
00:1d.7 USB controller: Intel Corporation N10/ICH 7 Family USB2 EHCI Controller (rev 01)
00:1e.0 PCI bridge: Intel Corporation 82801 PCI Bridge (rev e1)
00:1f.0 ISA bridge: Intel Corporation 82801GB/GR (ICH7 Family) LPC Interface Bridge (rev 01)
00:1f.1 IDE interface: Intel Corporation 82801G (ICH7 Family) IDE Controller (rev 01)
00:1f.2 IDE interface: Intel Corporation N10/ICH7 Family SATA Controller [IDE mode] (rev 01)
00:1f.3 SMBus: Intel Corporation N10/ICH 7 Family SMBus Controller (rev 01)
02:00.0 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168B PCI Express Gigabit Ethernet controller (rev 02)

In my windows machine I have the config like this:

I'm new to Ubuntu, I need some help in setting up my internet connection!! Thanks in advance.

Yep... you need a driver. The best plan is to get the driver on your windows machine, then boot to linux and compile it. You can follow the steps found in this guide at the Ubuntu Forums:

Download the driver and expand it into a new directory. cd to the
top directory in the expanded directory.
sudo make clean modules
sudo make install
Verify that a new file named r8168.ko exists in the directory
/lib/modules/3.2.0-24-generic/kernel/drivers/net/ethernet/realtek/.
blacklist r8169.
Edit /etc/initramfs-tools/modules and add a line with "r8168" in it.
sudo depmod -a
sudo update-initramfs -v -u -k  uname -r
Reboot

This is as a bug in Ubuntu 12.0.4 (bug: #145382 | broken 70-persistent-net.rules)

The fix is:

look into your settings what is your NIC MAC address and remember it > $MAC
nano /etc/udev/rules.d/70-persistent-net.rules
Look up for:

  SUBSYSTEM=="net", DRIVERS=="?*", ATTRS{address}=="$MAC",
  NAME="eth5"

Rename it as NAME='eth0'
Make sure your /etc/network/interfaces is correct
Reboot


Disable "ondemand" CPU scaling daemon I have a server that, as of the upgrade to 10.04, is now running the "ondemand" CPU scaling daemon.  Why would it automatically install this?  I don't want my server saving power at the expense of performance.

Ubuntu prior to 18.04
Instead of disabling execution of the /etc/init.d/ondemand (as suggested by George) script you should use the this command
sudo update-rc.d ondemand disable

To make the init system not start the script, this is the recognized way of doing it! Disabling the exec permission (sudo chmod -x /etc/init.d/ondemand) might be overwritten if the package is updated.
Ubuntu 18.04+
Ubuntu relocated this script to ondemand.service which execute /lib/systemd/set-cpufreq; use this command to disable the service
~$ sudo systemctl disable ondemand
Removed /etc/systemd/system/multi-user.target.wants/ondemand.service.

This is old, but since no one mentioned it, and for the sake of completeness, I will add that the argument how CPU which runs on the maximum speed will waste power, produce heat, fan noise etc. is WRONG.

Almost all modern CPUs, especially Desktop / Server CPUs, will enter deep sleep mode when idle (google race to idle.).

Voltage scaling will probably save more power, so on laptops this could increase running time a little, but on desktop and servers running performance governor will be fine for most of 'normal' users (who don't run server farms or similar.).

I use performance gov with my i7-2600k and the CPU temperature is usually around 30 C.


WiFi disconnects periodically Every thirty minutes or so, my wifi seems to stop working (on one specific network). The network disconnects, and I usually have to restart the computer in order to get reconnected. The security is wpa2. Other devices in the range do not do the same.

$ lspci -knn | grep Net -A3

returns

04:00.0 Network controller [0280]: Intel Corporation Wireless 7265 [8086:095b] (rev 59)
    Subsystem: Intel Corporation Dual Band Wireless-AC 7265 [8086:5210]
    Kernel driver in use: iwlwifi
    Kernel modules: iwlwifi

There are not any specifics to go on here, but I will offer an educated guess based on 11 years using UBUNTU and other Linux distributions. You say this is happening on just one of a field of wifi signals available to you. That suggests that the problem is upstream of your machine. I have run into similar glitches with wifi connected to providers with oversold bandwidth. Somehow the provider times you out and drops the connection. You can log back in when band width becomes available again on the provider's equipment. So, I don't think this is a problem with your hardware or software.


Skype and VLC sounds sizzle/distorted/bad I have the same problem as described in the questions skype notification sounds sizzled and bad sound on login to skype. But it is not only the login, notification, but also when talking to somebody. I tried the solution to remove/re-install skype and most of the solutions in this questions, e.g. checking mixer, sound settings and installing alsa-hda-dkms (incl. system restart).
After installing skype (and even after upgrade to skype 4.0) in Ubuntu 12.04 (AMD 64) there was no sound at all. I followed the first step of the SoundTroubleshootingProcedure and at least there is now sound:

sudo add-apt-repository ppa:ubuntu-audio-dev/ppa; sudo apt-get update;sudo apt-get dist-upgrade; sudo apt-get install linux-sound-base alsa-base alsa-utils gdm ubuntu-desktop  linux-image-`uname -r` libasound2; sudo apt-get -y --reinstall install linux-sound-base alsa-base alsa-utils gdm ubuntu-desktop  linux-image-`uname -r` libasound2; killall pulseaudio; rm -r ~/.pulse*; sudo usermod -aG `cat /etc/group | grep -e '^pulse:' -e '^audio:' -e '^pulse-access:' -e '^pulse-rt:' -e '^video:' | awk -F: '{print $1}' | tr '\n' ',' | sed 's:,$::g'` `whoami`

The jittering sound would sometimes disappear, e.g. on the Echo-Testcall after replaying the recorded part. And I noticed that if I let music play in the rhythmbox and then start skype, the sound is fine. So I have a weak solution, but I would be glad it would work without this detour.

In VLC when I play, restart after pause I have to same jittering sound.

As requested: My sound card is a an "AMD High Definition Audio Device" called Advanced Micro Devices (AMD) Hudson Azalia controller (rev01), subsystem Lenovo Device 21ea (according to sysinfo) on a Lenovo Thinkpad Edge 525.

It's not just a problem with Skype, I believe it's a problem with, you've guessed it, PulseAudio.

Workaround? Indeed there is.

Disabling PulseAudio's Glitch Free Audio seems to have solved the crackling for me (which became unbearable on Ubuntu 12.10 Beta 2)

To do this, edit the /etc/pulse/default.pa file in your favourite text editor.

Search for the following line:

load-module module-hal-detect

and append "tsched=0" to the end:

load-module module-hal-detect tsched=0

restart pulse (or just reboot your system), and the crackling should be gone.

Not sure what the side effects are by disabling Glitch Free Audio, but I can't seem to find any yet.

UPDATE:
If you don't have a line with load-module module-hal-detect, then search for following line:

load-module module-udev-detect

and append "tsched=0" to the end:

load-module module-udev-detect tsched=0

restart pulse (or just reboot your system), and the crackling should be gone.

You should check your internet connection (http://www.speedtest.net for speed test).

Also, as it works after RyhthmBox you could also try to update drivers (for sound card).

It could also help other answerers if you told us what kind of sound card you have in your computer.


ubuntu 14.04 login loop problem My Ubuntu 14.04 is stuck when trying to login my desktop. The screen goes black and soon after that the login screen comes back.

I followed all steps in Ubuntu gets stuck in a login loop but the issue was not solved.

You can either create a new user as suggested by ColonelTrogdor or there are other ways to solve this problem.
First login into tty by pressing CTRL+ALT+F1

Note: Press ALT+F7 to come out from tty

Solution 1:  Reset the Unity and Compiz

Download Unity Reset tool from here.

Note: It should work with Ubuntu 14.04, 13.10 and 13.04.
Reset Unity using the following command

$ unity-reset

Solution 2 (Most Recommended): Reinstall Ubuntu Desktop (i.e Unity)

sudo apt-get install --reinstall ubuntu-desktop

Solution 3: Install other Desktop Environment like,Gnome, KDE..etc

Now, I suggest you try Gnome Desktop. It also looks cool.

sudo apt-get install gnome-shell ubuntu-gnome-desktop

After trying any solution, just reboot your system.

$ sudo reboot

to avoid the login loop you can install and use different login manager or use new clean user account in your old login manager,if you want create new clean user account,install another login manager first (example:gdm) via command line if you dont have any,then change your login manager type "sudo dpkg-reconfigure lightdm" then change the login manager to gdm,next login into gdm with your old account,after that search for user account application, make a new account here and dont forget to make the password.after finished change your login manager back to lightdm,then login with your new clean user account.note that your new clean user account will use default setting for your ubuntu.


Not able to see windows option while installing Ubuntu I am new to Ubuntu, and trying my best after googling for details.
But not able to get the solution, hence landed here.

I had Windows 7 installed on my desktop PC.
Downloaded Ubuntu ISO.
Created USB installer using Universal USB Installer.
But made a mistake and chose my D drive rather than USB drive.
Then after restart, I started getting Ubuntu options for install, but it was installing , and windows boot option was not present.

So, I was not able to use Windows OS.
I finally created correct USB installer on my laptop, and now when i use that USB on my desktop, then it is showing Ubuntu options only, but atleast it is moving forward and showing steps for Ubuntu installer.
I am not sure whether it will delete my windows data, so what should i do in this case, so that I can use Ubuntu and Windows both?
Thanks in advance

In the ubuntu setup, select Something Else and select a drive partition on which windows isn't installed to install ubuntu.


Bluetooth adapter not found in Ubuntu 16.04 Since my upgrade to 16.04 the OS does not find the bluetooth-adapter anymore. The Laptop is an Acer Aspire V5-573G and all i can find about the bluetooth adapter is this: "Bluetooth Qualcomm Atheros Bluetooth 4.0". Here are some commands I executed, hope it helps:

Output of sudo lshw -class network:

*-network
       description: Wireless interface
       product: AR9462 Wireless Network Adapter
       vendor: Qualcomm Atheros
       physical id: 0
       bus info: pci@0000:04:00.0
       logical name: wlp4s0
       version: 01
       serial: 24:fd:52:ee:f4:b3
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress bus_master cap_list rom ethernet physical wireless
       configuration: broadcast=yes driver=ath9k driverversion=4.4.0-24-generic firmware=N/A ip=192.168.0.19 latency=0 link=yes multicast=yes wireless=IEEE 802.11abgn
       resources: irq:18 memory:b3500000-b357ffff memory:b3580000-b358ffff
*-network
       description: Ethernet interface
       product: RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller
       vendor: Realtek Semiconductor Co., Ltd.
       physical id: 0.1
       bus info: pci@0000:05:00.1
       logical name: enp5s0f1
       version: 14
       serial: 08:9e:01:ce:3d:ac
       size: 10Mbit/s
       capacity: 1Gbit/s
       width: 64 bits
       clock: 33MHz
       capabilities: pm msi pciexpress msix vpd bus_master cap_list ethernet physical tp mii 10bt 10bt-fd 100bt 100bt-fd 1000bt 1000bt-fd autonegotiation
       configuration: autonegotiation=on broadcast=yes driver=r8169 driverversion=2.3LK-NAPI duplex=half firmware=rtl8411-2_0.0.1 07/08/13 latency=0 link=no multicast=yes port=MII speed=10Mbit/s
       resources: irq:47 ioport:4000(size=256) memory:b3404000-b3404fff memory:b3400000-b3403fff

Output of lspci:

00:00.0 Host bridge: Intel Corporation Haswell-ULT DRAM Controller (rev 09)
00:02.0 VGA compatible controller: Intel Corporation Haswell-ULT Integrated Graphics Controller (rev 09)
00:03.0 Audio device: Intel Corporation Haswell-ULT HD Audio Controller (rev 09)
00:14.0 USB controller: Intel Corporation 8 Series USB xHCI HC (rev 04)
00:16.0 Communication controller: Intel Corporation 8 Series HECI #0 (rev 04)
00:1b.0 Audio device: Intel Corporation 8 Series HD Audio Controller (rev 04)
00:1c.0 PCI bridge: Intel Corporation 8 Series PCI Express Root Port 1 (rev e4)
00:1c.2 PCI bridge: Intel Corporation 8 Series PCI Express Root Port 3 (rev e4)
00:1c.3 PCI bridge: Intel Corporation 8 Series PCI Express Root Port 4 (rev e4)
00:1c.4 PCI bridge: Intel Corporation 8 Series PCI Express Root Port 5 (rev e4)
00:1d.0 USB controller: Intel Corporation 8 Series USB EHCI #1 (rev 04)
00:1f.0 ISA bridge: Intel Corporation 8 Series LPC Controller (rev 04)
00:1f.2 SATA controller: Intel Corporation 8 Series SATA Controller 1 [AHCI mode] (rev 04)
00:1f.3 SMBus: Intel Corporation 8 Series SMBus Controller (rev 04)
01:00.0 3D controller: NVIDIA Corporation GK107M [GeForce GT 750M] (rev a1)
04:00.0 Network controller: Qualcomm Atheros AR9462 Wireless Network Adapter (rev 01)
05:00.0 Unassigned class [ff00]: Realtek Semiconductor Co., Ltd. Device 5287 (rev 01)
05:00.1 Ethernet controller: Realtek Semiconductor Co., Ltd. RTL8111/8168/8411 PCI Express Gigabit Ethernet Controller (rev 14)

Output of rfkill list:

0: phy0: Wireless LAN
    Soft blocked: no
    Hard blocked: no
1: acer-wireless: Wireless LAN
    Soft blocked: no
    Hard blocked: no

dmesg | grep Blue does not have any output.

Output of lsusb:

Bus 001 Device 002: ID 8087:8000 Intel Corp.
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 002 Device 003: ID 04f2:b3d6 Chicony Electronics Co., Ltd
Bus 002 Device 009: ID 046d:c051 Logitech, Inc. G3 (MX518) Optical Mouse
Bus 002 Device 008: ID 046a:010d Cherry GmbH
Bus 002 Device 007: ID 1a40:0101 Terminus Technology Inc. Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Thanks!

I had the same problem. In my case I think it was a bug of my old installed version of unity control center, or some missing dependencies.
Resolved easily updating unity-control-center:

    sudo apt-get install unity-control-center

Hope it may help.


System settings won't open on Ubuntu 20.04 LTS after adding System76/pop PPA I'm trying to open System Settings but it won't open in any way.
Using GUI, Settings are trying to load for a moment and then they are gone.
Using Terminal (gnome-control-center), I get:
(gnome-control-center:8823): GLib-ERROR **: 14:44:15.433: ../../../glib/gmem.c:138: failed to allocate 13477064712 bytes
Trap Trace/breakpoint (core dumped)

I tried:
sudo apt-get remove gnome-control-center
sudo apt autoremove
sudo apt-get install gnome-control-center

With multiple reboots, but I had no result.
UPDATE!: Same errors persist BUT, when I type:
sudo gnome-control-center

(instead of just "gnome-control-center") suddenly System Settings appear! Is it a user permissions issue? Any suggestions?
UPDATE#2: After some system updates, sudo gnome-control-center now spawns "Segmentation fault".

Finally I found a solution!
The cause of this problem was pop-theme, that I installed once, plus its repository entry, that provided me the broken System settings (gnome-control-center). In order to solve this:

I installed Ubuntu desktop PPA.
sudo add-apt-repository ppa:ubuntu-desktop/ppa

I removed all System76/pop (and other trush) entries, with update-manager, leaving Ubuntu desktop the only one active.

Now that I have the proper repository entry added, I re-install gnome-control-center.
sudo apt install --reinstall gnome-control-center

Enjoy Gnome System settings!

immediate and simple way to circumvent the problem is to

open a shell
enter command: ~$ sudo gnome-control-center


Ubuntu 19.10 Cant Add SMB Printer Trying to add a SMB printer that is shared on a Windows box. I can successfully access the fileshares but when I try to browse for a printer in the Ubuntu Printers dialog it tells me "Additional Packages Required" and when I follow this to Software it gives me a frowny face and says "Unfortunately the python3-smbc you were searching for could not be found." I have had no trouble installing other things both through Software and (my preference) through apt on the Terminal.

This appears to be a bug in the packaging of 19.10. Question is, how do I resolve?

The same error occurred in my installation of Ubuntu 18.04 this is how I resolved it,

sudo apt install smbclient

I don't remember exactly but the same problem in my friends laptop resolved after running the following command python3-smbc is the package that was mentioned in the Ubuntu store error

sudo apt install python3-smbc


Full screen in virtualbox I have a Macbok Pro 13" and I'm using virtualbox to run ubuntu 12.04. My problem is I can't resize ubuntu for occupy the 13" of my screen when I use full-screen mode. Ubuntu only allows me to use two screen size options, 1024x768 or 800x600. The 800x600 option is too small, and cuts the screen in a smaller size with black edges.With the 1024x768 option, i only have black edges on the left and on the right. Is there any option for extending the image at the whole screen?

When logged into the virtual machine, find the virtual Box menu (usually at the bottom center), Navigate to "Devices >> Install Guest additions". It has the shortcut key host+D

This will ask to download the .iso CD image.
Select Yes, and once the download completes it it will ask you if you want to install the same.
Select Yes again, and let it install.
Restart the Virtual machine, if needed.

Enjoy!

you need to install the guest additions in order to access the fullscreen mode


Rhythmbox (or any music player) doesn't change songs properties I have some songs in my Rhythmbox, but I cannot change their properties, i.e., I cannot write anything in the properties window. It seems to be block or something like that.

I thought that such files are read-only or protected but I change such properties with sudo and nothing changed.

Any idea?

I had the same problem and noticed after a while that I was trying to change a .wma file. So instead of switching to another player (I really like rhythmbox) I used the sound converter (via software center) to convert it to .mp3. Close and start rhythmbox and now I could edit the id3 tags.

Try using

sudo chmod -R 777 /*YourMusicDirectory*/

For exmaple, if your music is in /home/USER/Music; it is like:

sudo chmod -R 777 /home/USER/Music

In USER, put your user name.
I am not a english native speaker, sorry if I made mistakes.


How to recover root user I have accidentally changed the root user from administrator type to basic type in the user account page, and now i have no whatever root previligaes on the system, how i can switch back to administrator type?

Assuming you have not actually changed the root user but removed the first user from the list of administers then this is relatively easy to fix.

Press CTRL+ALT+T and enter id

You should see something similar to.

~$ id
uid=1000(warren) gid=1000(warren)groups=1000(warren),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),109(lpadmin),124(sambashare)

If this shows sudo you should be an administrator. In Ubuntu prior to 12.04 the group was admin If not this is the problem.

First you need to boot to a root shell if you don't normally see grub when you boot hold SHIFT.

You should see something like this:

Select recovery mode, then drop to root shell.

Finally mount the file system read write

mount -o rw,remount /

If the problem was that you were not in the sudo group it can be fixed with

usermod -aG sudo warren

replacing warren with your user name.  If you are not sure what the user name should be it was the uid= field from the id command you ran earlier.

replace sudo with admin if you are using a version of Ubuntu prior to 12.04.

Another less likely possibility is that you have changed the sudoers file

If this is the problem then enter

visudo

Edit this file to look like this (12.04 default):

#
# This file MUST be edited with the 'visudo' command as root.
#
# Please consider adding local content in /etc/sudoers.d/ instead of
# directly modifying this file.
#
# See the man page for details on how to write a sudoers file.
#
Defaults    env_reset
Defaults    secure_path="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"

# Host alias specification

# User alias specification

# Cmnd alias specification

# User privilege specification
root    ALL=(ALL:ALL) ALL

# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL

# Allow members of group sudo to execute any command
%sudo   ALL=(ALL:ALL) ALL

# See sudoers(5) for more information on "#include" directives:

#includedir /etc/sudoers.d

Go to the User Accounts.

Image from Eliah Kagan's answer to How to manage users and groups?

Then, click on 'Advanced Settings'.

Image from How to create a Ubuntu 12.04 x64 LTSP server with 32bit thin clients by The Fan Club

Then, tick any boxes you want. The one you want though, is Administer the System.

Hope this helps!!


Ubuntu won't let me boot alongside other operating systems I deleted the Ubuntu partition and started the Ubuntu installer up on a USB. The first time, I got the option to install alongside windows. However, I clicked an incorrect option and wanted to go back. I couldn't, so I restarted my computer. Now, I get the warning that UEFI mode could erase my other operating systems, but don't have the option to install Ubuntu alongside my other operating systems.

I'm assuming that your computer have UEFI activated as default, so when you tried to install Ubuntu, the GPT table was corrupted, if you want to fix things and being able to install Ubuntu without that error message, recovering the Windows Boot Manager can fix all, and then you'll be able to do the installation aswell.

Please see this for repairing your Windows Boot Manager. Just do the first step.

Maybe you'll need another PC for getting the pendrive ready.

Btw if you want a rapid solution, you can configure Ubuntu with the manual installation, but I'm not sure you'll want that because is hard.


How to allow another user in a group to read a file I need help in this question please I have tried several times. Create a file, /home/jack/secretf7b079, containing the string secret5cd51b. Make sure the file is owned by jack. Use a group to enable cedric to also read the file, but not write to it. Make sure pedri can't access the file.
The code I have used by jack user:
cat > /home/jack/secret7b079 and include the string secret5cd51b.
sudo adduser cedric jack, to add the user cedric to jack group.
chmod 640 /home/jack/secret7b079
Thanks!

Don't add Cedric to group jack, because that is Jack's personal group. It's a security violation.
In addition to that, in new versions of Ubuntu, the default access to home accounts and files will be 600 for files and 700 for folders, i.e. groups and others can't access the area at all. This is recommended for security, because in previous versions, anyone could access (but not modify) anyone else's data.
You can explicitly set this in older versions of Ubuntu for all of the various home folders as follows:
sudo chmod --recursive go= /home/

A side effect of this is that no matter how you set your secret file within Jack's folder, no one can access it. That's a Good Thing (as Winnie the Pooh might say), both for security and because Jack's folder is personal to Jack.
So…
The right way is to create a brand new folder, not in Jack's area, that all permitted people, and only permitted people, can share.
You specify who may share with a new common group created just for the purpose. You assign the file's ownership to Jack, who can write to the file, and the file's group to the new common group, whose members can read but not modify the file.
Here are the steps. For this example, I've used the folder /home/secshare and the group name secacc, but you can choose a different name for both the folder and the group name (they can have the same name as each other, if you like).
sudo groupadd secacc                           # Create the new security group.

sudo mkdir /home/secshare/                     # The folder to hold the security file.
sudo chown jack:secacc /home/secshare/         # Jack owns the folder. Group has access.
sudo chmod u=rwx,g=rx,o= /home/secshare/       # Jack: rw. Group: r. Others: none.

# Create the file.
echo secret5cd51b | sudo tee /home/secshare/secret7b079

sudo chmod g=r,o= /home/secshare/secret7b079   # Owner: rw. Group: r. Others: none.

# Assign Jack as the owner, and secacc as the group.
sudo chown jack:secacc /home/secshare/secret7b079

# Double-check permissions.
sudo ls -l --directory /home/secshare/
> drwxr-x--- 2 jack secacc 4096 Feb  8 11:48 /home/secshare/
sudo ls -l /home/secshare/
> -rw-r----- 1 jack secacc 13 Feb  8 11:48 secret7b079

# Assign both Jack and Cedric to the group secacc
sudo usermod --append --groups secacc jack
sudo usermod --append --groups secacc cedric

At this point, Jack has full access to both the folder and the files within.
Cedric belongs to group secacc and therefore has read-only access to both the folder and the files within.
Pedri, who doesn't belong to the group secacc, has no access to the folder, and no access to the files within (even if the files within have full read-write access to everyone — test it for yourself).

If you can use ACL: setfacl -m u:cedric:r /home/jack/secretf7b079 - grants user cedric read access to file.
But sounds like you want solve homework on askubuntu ;)


Thunar not browsing local network Client:

OS: Ubuntu 18.04

Host:

OS: Windows 7
Hostname: WINDOWS-BOX

When I select Browse Network in Thunar, I only see UBUNTU-BOX and an empty Windows Network folder.  If I enter smb://WINDOWS-BOX/users, after typing username and password I can browse it without problems.

How do I browse computers/shares from within Thunar without knowing their addresses beforehand?

If the OS in question is Win7 edit /etc/samba/smb.conf and right under the workgroup = WORKGROUP line add this one:

client max protocol = NT1

If you don't have an smb.conf file add the following package:

  sudo apt install smbclient

Can you "see" the WIn7 box under Windows Network now?

Notes:

** If you have a Win10 machine in your network you will experience a paradox. With the NT1 setting you will "see" it but will be unable to connect to it because Win10 disabled NT1 ( aka SMB1 ). If you don't have the NT1 setting you will not be able to see the Win10 machine but will be able to access it like you did above ( smb://win10 ).

** In an all Linux network or one with macOS all of them will be visible ( or can easily be made visible ) and accessible regardless of the client max protocol setting because they don't have to use netbios for host discovery.

Find it once, right click, create shortcut, it'll then appear in the left pane in Thunar.

Add shares you use regularly to fstab so they're auto-mounted a bit like the Windows mapped drives feature. With recent distros you'll be using SMBv3 that way which is more efficient and much more secure.

This avoids forcing use of an old, insecure & long deprecated protocol "NT1" a.k.a. SMBv1 can anyone say "WannaCry"? There are lots of other problems with it, which is why Win 10 is pushing hard towards complete removal, it's now auto-removed if not used in the first 15 days post install, I foresee in a few feature updates time it plain not being there at all.

At which point the widely posted bad advice to set client max protocol will thankfully stop working.

Put a post-it on the edge of your monitor with the machine details.  Reserve IP addresses in DHCP or use fixed addresses & populate your hosts files if you have to.

Anything except forcing SMBv1.


Bash skips password prompt I have the following little script:

#!/bin/bash
cd ~

thunderbird &
firefox &

sudo apt-get update
sudo apt-get upgrade

It worked for the last two years, but for a few days it skips the password prompt. Output (without any actions from me, except starting the script):

me@UBUNTU:~$ sh goodmorningscript.sh
[sudo] password for me:
[sudo] password for me:
me@UBUNTU:~$

It just runs through, without stopping and waiting on the password prompt.
I don't want a solution without entering my password.

What could have caused my Ubuntu to skip the prompt and how can I solve it?

Note: If I manually enter sudo commands, the prompt works as expected.

GNU bash, version 4.4.19(1)-release (x86_64-pc-linux-gnu)

Ubuntu 18.04.1 LTS

I found one possible solution, that works in my case. If the sudo command comes before the ones with &, the password prompt works as expected:

#!/bin/bash
cd ~

sudo apt-get update
sudo apt-get upgrade

thunderbird &
firefox &

I still don't know why, but maybe this helps.

I had the same problem when using the terminal. Just restarting the terminal fixed it for me.

It is most likely that you have used sudo (with some other command) before executing your script.

sudo effect stays for a while (default 15 minutes).
Try waiting for a couple of minutes. Or close and reopen your terminal and try again.

If the same behaviour persists a bit more information will be required in that case. Run sudo -l and paste the output here


What is the Tomcat installation directory? Based here I'm trying to setup Tomcat Server, I have successfully installed it and tested it. Then I stopped it as recommended in the tutorial. I'm setting up "New Server Runtime Environment" as you can see under Tomcat Installation Directory is a windows directory, anyone knows the Ubuntu directory equivalent for this? Thanks.

There are three important directories for Tomcat:

/etc/tomcat{X} for configuration
/usr/share/tomcat{X} for runtime, called CATALINA_HOME
/usr/share/tomcat{X}-root for webapps

The alternative path to Tomcat, called CATALINA_BASE, is /var/lib/tomcat{X}

The temp folder for Tomcat is /tmp/tomcat{X}-tomcat{X}-tmp

All the above paths work for Tomcat 6, 7, and 8. Replace {X} with the appropriate Tomcat major version number, e.g. /etc/tomcat8.

These are some of the key tomcat directories:

/bin - Startup, shutdown, and other scripts. The *.sh files (for Unix systems) are functional duplicates of the *.bat files (for Windows systems). Since the Win32 command-line lacks certain functionality, there are some additional files in here.
/conf - Configuration files and related DTDs. The most important file in here is server.xml. It is the main configuration file for the container.
/logs - Log files are here by default.
/webapps - This is where your webapps go.

You may check where there are by the following commands:

dpkg -L tomcat7
dpkg -L tomcat7-common

Change tomcat7 to your appropriate package name. By default for Tomcat7 it's usually /usr/share/tomcat7.


Bash history handling with multiple terminals I use mainly Terminator, and it's usually opened with 3 split terminal windows. I also use Gnome terminal for various reasons.
I'm wondering how is bash history handled in this case as I sometimes miss previously issued commands when I run history

For example, my prompt shows current bash history line (\!) and if I launch Terminator with 3 split terminal windows I get same history line (let's say 100) on all terminals. Which history will be saved?

Also launching Gnome Terminal after using Terminator I get line 100 at startup regardless all commands issued before in Terminator

The bash session that is saved is the one for the terminal that is closed the latest. If you want to save the commands for every session, you could use the trick explained here.

export PROMPT_COMMAND='history -a'

To quote the manpage: “If set, the value is executed as a command prior to issuing each primary prompt.”
So every time my command has finished, it appends the unwritten history item to ~/.bash_history before displaying the prompt (only $PS1) again.
So after putting that line in /etc/bash.bashrc I don’t have to find myself reinventing wheels or lose valuable seconds re-typing stuff just because I was lazy with my terminals.

Anyway, you'll need to take into account that commands from different sessions will be mixed in your history file so it won't be so straightforward to read it later.
See also:

https://unix.stackexchange.com/questions/1288/preserve-bash-history-in-multiple-terminal-windows

History from all shell sessions is less useful than I hoped!
I enthusiastically set PROMPT_COMMAND='history -a; history -r' in the hopes that my history usage would be much better!
Wow, was I disappointed.
Essentially, doing this makes up/dn arrow useless.  Because now each history session is littered with commands from other sessions.  And for me this loses the best feature of history.
What I really wanted
Occasionally, I wanted to essentially transfer my history from one terminal session to another session so I could easily recall commands from that session.  And I can do this very selectively.
What I did
I set up a series of simple history manipulation aliases & I ignore these commands in the history:
alias ha="history -a"
alias hb="history -a; history -r"
alias hr="history -r"
alias hl="history | tail -20"
HISTIGNORE="ha:hb:hr:hl"

I think of hb as history blend...the others are self-explanatory.
Now when I want to copy my history from session A to session B, I can do this:

A: ha - append session A history to history file
B: hb - append session B history to history file and then read the file

This essentially preserves the history order for session B and adds session A history deeper in the list.
Super useful for me.  Maybe helps you too!


Dell Laptop E6430 DVD Doesn't Work in Ubuntu 20.04 (Files and VLC) But Will Boot From BIOS I can use USB booting no problem and in case it was a problem with the internal DVD drive I went ahead and bought another DVD drive only this time USB and external.  I can't play movies and this is the crux of the matter.  I have searched thru AskUbuntu, LinuxQuestions and I can't get an answer.  Can someone lead me in the right direction?  I have attempted to install everything that I have found and it installed as far as libraries are concerned and still nothing.  Thank you in advance.

For DVD-Video playback in any internal or external drive you need the following:
sudo add-apt-repository multiverse   #only needed if the multiverse repository isn't enabled
sudo apt install libdvd-pkg

Use TAB then cursor keys to navigate and answer "OK" in the following screens. Then:
sudo dpkg-reconfigure libdvd-pkg

and again use TAB and cursor keys to navigate and answer "Yes" to the following screens.
Source: https://help.ubuntu.com/community/RestrictedFormats/PlayingDVDs
In Ubuntu 20.04 you may find an error about a missing libdvdread7 library. Install it:
sudo apt install libdvdread7

Lastly, you may want to install VLC. And for good measure install adiitonal codecs and fonts (important for other media players; VLC uses its own set of codecs):
sudo apt install ubuntu-restricted-extras

(NOTE: Use xubuntu-restricted-extras for Xubuntu and lubuntu-restricted-extras for Lubuntu.)

You said can't play DVD movies, so I assume you miss this thing. Open terminal copy below command past it to your terminal.
sudo apt install ubuntu-restricted-extras
This is wrong opinion kindly don't take serious sorry for the trouble my bad.


Prevent gnome-shell's dash from listing Recent Items I am using gnome-shell in Ubuntu 11.10. I am getting annoyed when dash search lists Recent Items. I have tried many ways to prevent it like

Deleting activity.sqlite and activity.sqlite-journal files under ~/.local/share/zeitgeist
Adding all the possible entries in Activity Log Manager to prevent application logging
Specifying time range in Activity Log Manager to forget my activities.

But none of the methods are working. The recent items list is still populated.

Is there any way to tell dash not to list Recent Items while searching, other than the above methods? Or is there any way to delete the recent items list?

Gnome-shell uses recently-used and not Zeitgeist to display your recent items.

to disable it follow theses steps:

delete recently-used.xbel:

rm ~/.local/share/recently-used.xbel

create a new empty file:

touch ~/.local/share/recently-used.xbel

make sure the new file cannot be modified:

sudo chattr +i ~/.local/share/recently-used.xbel

now, your display of recent items is gone.

If you want to revert back, remove the i attribute of recently-used.xbel:

sudo chattr -i ~/.local/share/recently-used.xbel

all credits to : http://knezevblog.blogspot.com/2010/05/how-to-ubuntu-clear-and-disable-recent.html

use cairo dock to delete your recent history...
instal cairo dock first,,and then run it,,
right click on recent-events,,,then choose "Delete today's events" or "Delete all events"
I hope it can help


Removing Ubuntu from UEFI Bios Menu I have a Lenovo Ideapad Y510P. I recently removed Ubuntu 12.04 from it, and did a reset on the Windows 8 Partition. However, I still have the Ubuntu option in the firmware (not bios) boot menu, and I want to get rid of it.

The problems are (I looked this up ahead of time):

In order to boot into the Ubuntu USB I have, I need to be in Legacy Mode.
In order to run sudo efibootmgr in Ubuntu, I need to be in UEFI Mode. Right now, when I run it, I get the:

couldn't open either sysfs or procfs directories for accessing EFI variables

error (I tried sudo modprobe efivars before it and after it and it looked like it did nothing).
I can't be in both modes at once.

You can do this easily using Visual BCD Editor in Windows 7/8/10.

Map EFI System drive to Z: using

mountvol z: /s
Run Visual BCD Editor and select "Store","Backup store".
a)Click on browse icon in dialog and using the explorer window select
z: drive - now you have full access to EFI System Partition (ESP).

b)Click on EFI folder to expand - you will see "Boot", "Microsoft"
and "ubuntu" folders if you have Windows and Ubuntu installed.

c) You can delete "ubuntu" directory by selecting it and pressing
"Del" key.
In Visual BCD Editor click on loader entry "Ubuntu" to select it and then press "Del" key to delete.

After reboot Ubuntu boot option in UEFI boot menu will be completely gone.

Note:

You could alternatively use bcdedit.exe to delete EFI boot entry for Ubuntu and use command prompt to delete "ubuntu" folder from EFI System Partition (drive z:) if you feel more comfortable with commands.

For this you need to install ubuntu again.

After installing open terminal and login as root using command:

sudo -i

Enter your password, then navigate to root/efi/EFI and delete all directories in it and finally delete the EFI folder and efi.
Now ubuntu will be removed from your boot menu.
Finally delete the ubuntu partitions from windows partition manager.


Why am I offered an upgrade from 14.04 to 15.10, instead of 16.04.1 I have been waiting for 16.04.1.  On 22/07/16, I received the email from Adam Conrad, informing that the upgrade was now available.

I opened Software Updater, but it only offered me an upgrade to 15.10.

Why is this?

Garry

The upgrade was offered to me late on Friday 29/07/16 (Australian EST).

Thanks for the comments...

Because 15.10 is not end of life yet. It is today but that will be at the end of the day, not in the middle.

The 14.04 to 16.04.1 is NOT active yet. It should be yes, but it is not.

The reason that you were not offered an upgrade from 14 to 16 is because attempts to upgrade from 14 to 16 have been known to cause severe failures (requiring re-install).

If possible: Clonezilla backup before any upgrade. A fresh 16-install can save you a lot of headaches and time.


How to move my Home-Directory? I have three partitions on my netbook:

ntfs with windows 7
ext 4 with Ubuntu 11 and
fat32 for my private data

On the fat32-Partition Ubuntu und Windows 7 should share my private data.

How could I move my home directory with the exiting files to the fat32-partition? And how do I mount this partition permanently as my home-directory?

Many thanks for an helpful answer.

As per my point of view
please understand the merit and demerit of moving home folder to other file system

  NTFS is not suitable for an home partition, there are certain type of file system objects (character devices, named pipes, etc) which are required for certain services but are not supported on NTFS. source

It's not a good idea to have the whole of /home in a fat32 or NTFS partition because those two Windows filesystems don't support Linux permissions. Also, the /home folder has many hidden files and folders (these have a leading . i.e for hidden files) for configuration and I don't know what effect this would have in Vista, or whether Vista would interfere with these..

But what I do is to have a separate NTFS partition for data and set up symlinks from my /home in Linux and whatever the equivalent is in Windows (links? shortcuts?  ). So - say I have a 'Music' folder in my NTFS data partition, then I create a symlink called 'Music' in my Linux home and a link called - yes, you've guessed it - 'Music' in Windows My Documents. (I'm using XP.) In fact I also multiboot several Linux distros, so I do the same in each. Whichever distro/OS I'm in I can access the same files from my home folder by double-clicking on the symlinks (which look like folders with bendy arrows in Linux)

If I am wrong correct me

Follow these commands

usermod -d /home/your_home_directory USERNAME

chown -R USERNAME /new_location/your_home_directory


Installing multiple jdk versions ubuntu 11.0 I am starting mobile apps development using java. I have successfully set up netbeans IDE. I want to be able to use the Sun Wireless Toolkit (WTK 2.5.2) emulator to test my applications. However, when I test run my apps, the emulator isn't started.

A thorough search on the internet indicated that the WTK I am using is targeted for JRE 32 while the one I have in my system is the 64 bit version. The only remedy suggested was to install the jdk 32 bit version and point WTK to that version.

How do I install the 32 bit version of jdk while at the same time keeping the 64 bit one?

Below are my specs:

1. Intel Core i3
2. Ubuntu 11.10 desktop operation system.
3. my jdk installation path (64 bit version) /usr/lib/jvm/java-6-openjdk

It turns out that, all I need to do is download the self extracting 32 bit jdk version package for ubuntu and install it in any location of choice which should be different from the one current 64 bit version is sitting (In my case I put it in /opt/jvm/). Below is a step by step explanation of what I did to make it work.

Download relevant 32 bit version of jdk (I used java jdk-6u32-linux-i586.bin) found here
make it executable by running the following command

chmod +x jdk-6u32-linux-i586.bin

extract this file by simply executing it (Remember it is self extracting). That is run the following command on terminal. (Make sure you are in the directory in which the file is stored).

./jdk-6u32-linux-i586.bin

Note: the contents will be extracted into directory(its name will be jdk1.6.0_32 in this case) which will be created in the current directory.
Copy the directory created in step 3 above into whatever location you want to install the jdk (in my case /opt/jvm). Note that you have to create jvm in opt if it is not yet created. See commands to use below.

sudo mkdir /opt/jvm
sudo cp -r jdk1.6.0_32

Edit /path-to-where-netbeans-is-installed/netbeans7.1/mobility/WTK2.5.2/bin/emulator and change the variable javapathtowtk  to point to newly installed jdk bin directory (that is in my case  it is as shown below).

 nano /home/willa/netbeans7.1/mobility/WTK2.5.2/bin/emulator

 #!/bin/sh
 javapathtowtk=/opt/jvm/jdk1.6.0_32/bin/

Save and exit. And voila enjoy you can now run your applications using WTK2.5.2 emulator.

Download whatever version you need from oracle web-page and install it.

http://www.oracle.com/technetwork/java/javase/downloads/jdk-6u32-downloads-1594644.html

use *.bin file.


logitech f510 and f710 are not working Moved to ubuntu 14.04 not so long ago. I had Logitech f510 and f710 while using windows, but I was not able to make them work on my ubuntu system.
What was done - installed xboxdrv. After it installed qjoypad and jstest-gtk but they are not able to see my gamepads. Tried Logitech Rumble Gamepad F510 and How do I configure a joystick or gamepad? with no luck. And find out that actually my problem is that device is not listed in /dev/input and I'm not sure what to do to move it there.

Here is dmesg output:

[ 2014.619530] usb 3-2: new full-speed USB device number 7 using xhci_hcd
[ 2014.639445] usb 3-2: New USB device found, idVendor=046d, idProduct=c21e
[ 2014.639450] usb 3-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[ 2014.639454] usb 3-2: Product: Rumble Gamepad F510
[ 2014.639456] usb 3-2: Manufacturer: Logitech
[ 2014.639459] usb 3-2: SerialNumber: B289B4F3

lsusb:

Bus 003 Device 007: ID 046d:c21e Logitech, Inc. F510 Gamepad [XInput Mode]

With the evtest I can't see device listed and there are no js* files in /dev/input.

Will be glad for any advice. Thanks.

I fixed it reinstalling ubuntu. No idea what happened.