How can I get my current location/coordinates by IP from the command line? It seems like there is a package called geoclue which uses Mozilla's location service to lookup wireless access points and their known location, but there doesn't seem to be a command line interface for this. Is there another way to do it? Any clever hacks?

If you want IP based lookup... (but you'll have to fix the HTML formatting of the output)

wget http://cqcounter.com/whois/my_ip_address.php && egrep "IP Location|City|Latitude|Longitude" my_ip_address.php

There is a workaround that use your IP and find your location based to your Real IP.

first install lnyx

sudo apt-get install lynx-cur

Now the command is:

lynx -dump http://www.ip-adress.com/ip_tracer/?QRY=$1|grep address|egrep 'city|state|country'|awk '{print $3,$4,$5,$6,$7,$8}'|sed 's\ip address flag \\'|sed 's\My\\'


Installtion Nightmare on iMac Well I have searched far and wide for some solutions but I decided to take all the problems I have had into one.

First I have a 27" Apple iMac (Late 2009 Release) running a intel i7, 4GB of RAM, and ATI Radeon HD 4850 card with the standard airport extreme 2 which is running MAc OS X Lion (10.7.4) I checked the hardware support and Ubuntu seems to be ok after some tweaking.

So here is what I did in the exact order based on some lengthy research.

First I downloaded rEFIt (version .14) and installed it. I did a quick halt and reboot and it work.

Next I wasn't sure whether to trust ubuntu to parition my main drive or handle it myself. So I decided to go for the self partitioning. Did you know that partitioning on Lion is not like partitioning on Leopard?

I ended up reparing the disk and rebooting into recovery mode and making the partitions there. I have a 1TB hard and I slipt it up as so (Approx.) MacOS = 575 Exfat(I called it Data) 350 and 75Gb Free Space.

Next I downloaded the 64 bit version of the newest ubuntu release Ubuntu 12.04.iso and burnt it to disk using the slowest write speed.

Next I inserted the disk and restarted the and held "C" it booted to from the CD and I was at the first menu in the Ubuntu phase. I first selected the Language then Install Ubuntu. Immediatly the screen went black but the disc was still reading. I immediatly realized this was Either a GUI issue or a Display issue. So I did some research and found out about the 'nomodeset' I did that and the install ran well. At least I thought. I restarted the Mac and waited for the EFI Boot menu or Grub menu. Nothing. So I shutdown and powered up again and this time held 'Alt' the menu came up and I selected the Windows Disk and then it went to the grub menu and I then had the choice again. I chose Ubuntu obviously. Purple screen popped up thenn!    Command Line. I figured the disk failed and so I connected to my wifi and then proceed to update and then install the ubuntu desktop. I tried running the startX command but got nothing ESC and f6 failed me and so I shutdown. When i rebooted the mac goes straight to OS X. Its quit bothersome and I am surprise that this is this difficult. I suspect the Recovery Drive Lion create is to blame.

Go to http://releases.ubuntu.com/raring/ and download the special mac version of the release. I just installed on a Macbook Pro 17" Late 2009 and it worked out of the box!

Also i suggest using rEFInd as rEFit is no longer in development.
If you don not want to struggle with the EFI booting just add the
   hdbios
option in your refind.conf file's
   scanfor
line.

You're likely going to want to download the latest 13.04 version, I have had a lot of issues with 12.x series and proprietary video cards. So far 13.04 is working much better in this regard.


nameserver 127.0.1.1 in resolv.conf won't go away! I've read that I should have nameserver 127.0.1.1 in my /etc/resolv.conf file only if my machine has its own DNS server. Since it doesn't, having it causes problems. But no matter what I do I can not get rid of it!

Here are the things I've done so far:

Adding nameserver 192.168.1.3 to /etc/resolvconf/resolv.conf.d/base file. (192.168.1.3 is our network's DNS).
Running: sudo resolvconf --enable-updates.
Running: sudo resolvconf -u.
Running: sudo service network-manager restart (just to make sure).

Yet when I open the /etc/resolv.conf file it says: nameserver 127.0.1.1! Does anyone have any idea what's wrong?

Please note that it's actually 127.0.1.1! And I have no idea why it's not 127.0.0.1!

Even when I update the /etc/resolv.conf manually and change it to anything else, the sudo resolvconf -u will revert it back to 127.0.1.1! Where is this address coming from?

NetworkManager is the program which (via the resolvconf utility) inserts address 127.0.1.1 into resolv.conf. NM inserts that address if an only if it is configured to start an instance of the dnsmasq program to serve as a local forwarding nameserver. That dnsmasq instance listens for queries at address 127.0.1.1.

If you do not want to use a local forwarding nameserver then configure NetworkManager not to start a dnsmasq instance and not to insert that address. In /etc/NetworkManager/NetworkManager.conf comment out the line dns=dnsmasq

sudo nano /etc/NetworkManager/NetworkManager.conf

[main]
plugins=ifupdown,keyfile,ofono
#dns=dnsmasq

and restart the NetworkManager service.

sudo service network-manager restart

In this mode, NetworkManager updates /etc/resolv.conf (still via resolvconf) to include the nameserver addresses NetworkManager has for active connections.

If you want to disable the resolvconf mechanism for updating resolv.conf and just use a static resolv.conf file, do the following.

sudo rm -f /etc/resolv.conf  # Delete the symbolic link
sudo nano /etc/resolv.conf   # Create static file

# Content of static resolv.conf
nameserver 8.8.4.4
nameserver 8.8.8.8

Ubuntu 16.04 + Ubuntu 18.04 Server - Configure /etc/resolv.conf to persist after reboot
On an Ubuntu 16.04 server, there is no /etc/NetworkManager/NetworkManager.conf file.
Executing the following command will show you that the /etc/resolv.conf file is linked to the /run/resolvconf/resolv.conf file:
sudo ls -la /etc/resolv.conf

Remove this file and regenerate it:
sudo rm -f /etc/resolv.conf
sudo echo '#== My Static /etc/resolv.conf File
#== ===============================
nameserver 8.8.8.8
nameserver 8.8.4.4' > /etc/resolv.conf

Now you will see that the link is no longer there and your static /etc/resolv.conf file is present.
sudo ls -la /etc/resolv.conf

Now to configure resolvconf NOT to regenerate the default /etc/resolv.conf file so your static file persists after reboot, execute the following command:
sudo dpkg-reconfigure resolvconf
ON the first screen, hit your tab button to select NO

ON the second screen, press your tab key to select OK and hit enter.

Your /etc/resolv.conf file will persist after rebooting your server.
Ubuntu 18.04 Server
If you add ips to your /etc/netplan/50-cloud-init.yaml file, more than likely you'll have to apply your new settings with netplan apply or netplan --debug apply. Doing this will recreate the /etc/resolve.conf link back to ../run/resolvconf/resolv.conf. If this happens, simply rm -f /etc/resolv.conf and recreate it as outlined above.
Now you need to chattr the file like so:
chattr +i /etc/resolv.conf
Your /etc/resolv.conf file will persist after rebooting your server.
If you need to edit the file, remember to reverse the chattr like so:
chattr -i /etc/resolv.conf
Now you can edit the /etc/resolve.cfg


How do I install and manage RPMs? I have a burning desire to install RPMs onto my Ubuntu installation - is this possible? Can I use Yum - or another RPM Package Management tool?

Can I use Yum

I wouldn't recommend it. You probably could compile it but you wouldn't have any Ubuntu-compatible package repositories for it to handle.

You can convert single RPM files into DEBs with Alien:

sudo apt-get install alien
sudo alien my_package.rpm
sudo dpkg -i my_package.deb

Note: It might change the filename a little more than just the extension.

This won't work for everything as packages link to other packages to fulfil dependencies. Obviously Red Hat/Fedora/CentOS use different package names to Ubuntu so you're likely going to run into a whole load of pain.

Chances are if a DEB doesn't exist, you'll be better off just getting the source and compiling it.

use alien which converts the rpm to deb and subsequently installs the deb.


How to install Windows 7 alongside ubuntu 14.04 lts I tried to dual boot Ubuntu with Windows 7 and it turned out that I booted only Ubuntu. All my data in windows 7 OS are gone. Is there any chance I can retrive those data? And I want to dual boot windows 7 now. How do I do it? If I do it will it be enough for me to get the datas back?

first try to get your data back, try if you can recover your lost partition with testdisk you can install it just by typing in the terminal

sudo apt-get install testdisk

it doesn't have a graphical interface so run in terminal by typing testdisk
and choose the appropriate hard drive and tell us the results


Installing dual-boot Windows 10 and Ubuntu on separate disks I have a new computer. It has a 128GB SSD with Windows 10 pre-installed on it. It also has a 1TB HDD. I would like to install Ubuntu on a partition (say 100GB) on the HDD for a dual-boot. I would like to be prompted which OS I want to boot on start-up.

I have searched for this online, but everyone seems to be saying something else, from just installing Ubuntu to manually setting up partitions and adding all sorts of entries in Grub.

Are there any problems I am overlooking? What makes the tutorials diverge so much from one another?

You would have to change the boot order of the drives depending on which OS you wish to boot if they are on separate drives.

If not then yes, you will need to add entries into GRUB.

Your best option would be to either:

A. Install Ubuntu, and Windows 10 on the SSD (Allocated 64GB to each which, should be plenty for the OS as long as if you have your /home on the HDD).

B. Install Ubuntu, and Windows 10 on the HDD and have your /home on the SSD, and install Windows programs to the SSD for faster load times.

Sadly, you will not be able to put both on separate drives without doing some type of work to it.

(Please note: I could be completely incorrect on this, but from personal experience, I have not been able to do this on 2 separate drives and still have an option to choose which OS I'd like to open from GRUB. However in BIOS, you will have that option).


In terminal, what is the path of my HDDs? I have 2 * 500-GB HDDs.
What is the path for each of the disks?
On OSX I can just do:

$ cd /Volumes/DiskName/FooDirectory

How can I do that on Ubuntu? How can I navigate to files in a HDD using a terminal? /dev and /dev/disk are not making sense to me.

On OS X those would be the mount points.  Under Ubuntu you would want to look at /media/USERNAME/ for those.  Though if the volume has not been mounted you could look at /dev/disk/by-label.

If the drives are paritioned and formatted, then you can navigate to them by doing something like cd /media/USERNAME/LABEL where USERNAME is your user name and LABEL is the label for the partition.

If your drives haven't been formatted, then you wouldn't see them in either location and you would instead want to look for /dev/sd[a-z].  That is, you'd have an entry like /dev/sda and /dev/sdb.  If they are partitioned, then you should also see /dev/sda[0-9] and /dev/sdb[0-9] (for example, /dev/sda1.)  But you'd have to at least format them before you can mount them and navigate to them...

If you haven't mounted the volumes, you can do it through nautilus by just clicking on the volume name.  Or from the terminal you can use udisksctl.  For example, I have a drive that is partitioned with just one file system.  The label of the drive is "d_extra".  I can view it in /dev/disk/by-label:

$ ls -l /dev/disk/by-label
lrwxrwxrwx 1 root root 10 Jul 17 15:34 d_extra -> ../../sdb1

Then, once I know the name, I can mount it via udisksctl like so:

$ udisksctl mount -o noatime -b /dev/disk/by-label/d_extra

Then I can cd to it and view files:

$ cd /media/stephen/d_extra
$ ls

On Linux you might have to login via terminal and use sudo. To go backwards you can use something like

cd down
cd Volumes/.../

//or

cd up
cd /.../Volumes
cd .../Volumes

//spaces in file name
cd /Volumes/My\Documents

FYI dev is your firmware and device files. On other Unix OSs' like Mac OS X they have created permission blocks on viewing those. Installing firmware from terminal is possible on Linux. Try not to tamper as your GUID may be stored there along with shadow hash files elsewhere in the file system and you don't want to create any open doors. Mac won't even allow output to text file. To help you understand the GUID hash being MD5 would take about three years to crack with 4 GBs of RAM. Its kind of serious.

Also try..

./Volumes/etc


How to change default terminal application in Gnome-Shell Gnome-Terminal is terrible.

It's buggy and whenever Gnome-Shell restarts or resumes from suspend, all Gnome-Terminal windows become unusable and can't be closed. There's an old ticket opened for it, but it'll likely never be fixed.

In the meantime, I've been trying to use other terminal packages. Unfortunately, Gnome-Shell still thinks Gnome-Terminal is what it should use whenever I select "open in terminal" in various menus. If I uninstall Gnome-Terminal, these menus disappear. What's the easiest way to keep the menus, but make my preferred terminal window open instead?

Or you may simply use:
sudo update-alternatives --config x-terminal-emulator
as per comment; to update it on per user basis check https://serverfault.com/questions/631447/how-to-use-update-alternatives-per-user

Ideally, there'd be an option under Details->Default Applications, but there's currently no option for "terminal".

My workaround was to install Terminator, or any other of the many GUI terminal packages which does suffer the gnome-terminal bug, and then symlink it to /usr/bin/gnome-terminal, e.g.

sudo mv /usr/bin/gnome-terminal /usr/bin/gnome-terminal.bak
sudo ln -s /usr/bin/terminator /usr/bin/gnome-terminal

The two binaries don't have identical parameters, but so far they seem to be similar enough that all my terminal launchers (nautilus-open-terminal, Eclipse, etc) all seem to pick it up seamlessly.


How to select video quality from youtube-dl? I have installed youtube-dl in my 14.04.

I can download video by following command,

$ youtube-dl [youtube-link]

But I want to know how to select available pixel quality of youtube video(i.e 1080p, 720p, 480p, etc).

In software description they said it's possible(shown in image below), but how to do..

To download a video, you type the URL after the command like so:
youtube-dl 'http://www.youtube.com/watch?v=P9pzm5b6FFY'

To select the video quality, first use the -F option to list the available formats, here’s an example,
youtube-dl -F 'http://www.youtube.com/watch?v=P9pzm5b6FFY'

Here’s the output:
[youtube] Setting language
[youtube] P9pzm5b6FFY: Downloading webpage
[youtube] P9pzm5b6FFY: Downloading video info webpage
[youtube] P9pzm5b6FFY: Extracting video information
[info] Available formats for P9pzm5b6FFY:
format code extension resolution  note
140         m4a       audio only  DASH audio , audio@128k (worst)
160         mp4       144p        DASH video , video only
133         mp4       240p        DASH video , video only
134         mp4       360p        DASH video , video only
135         mp4       480p        DASH video , video only
136         mp4       720p        DASH video , video only
17          3gp       176x144
36          3gp       320x240
5           flv       400x240
43          webm      640x360
18          mp4       640x360
22          mp4       1280x720    (best)

The best quality is 22 so use -f 22 instead of -F to download the MP4 video with 1280x720 resolution like this:
youtube-dl -f 22 'http://www.youtube.com/watch?v=P9pzm5b6FFY'

Or optionally use the following flags to automatically download the best audio and video tracks that are available as a single file:
youtube-dl -f best 'http://www.youtube.com/watch?v=P9pzm5b6FFY'

If you encounter any error during the muxing process or an issue with the video quality selection, you can use one of the following commands:
youtube-dl -f 'bestvideo[ext=mp4]+bestaudio[ext=m4a]/bestvideo+bestaudio' --merge-output-format mp4 'http://www.youtube.com/watch?v=P9pzm5b6FFY'

or as Gabriel Staples pointed out here, the following command will typically select the actual best single file video quality resolution instead of video quality bit-rate:
youtube-dl -f best 'http://www.youtube.com/watch?v=P9pzm5b6FFY'

These commands will ensure you download the highest quality mp4 video and m4a audio from the video as a single file or will merge them back into a single mp4 (using ffmpeg in my case). If ffmpeg or avconv is not available, youtube-dl should fall back to the single file -f best option instead of the default.
Click here for more detailed information and some different examples.
Also, click to see this related answer by Gabriel Staples.

Source: www.webupd8.org/2014/02/video-downloader-youtube-dl-gets.html
Source: github.com/rg3/youtube-dl

youtube-dl's idea of best is not perfect. Take this example for instance :
pi@rpi-lounge:~ $ youtube-dl -F https://youtu.be/Xj3gU3jACe8
[youtube] Xj3gU3jACe8: Downloading webpage
[info] Available formats for Xj3gU3jACe8:
format code  extension  resolution note
249          webm       audio only tiny   55k , opus @ 50k (48000Hz), 1.11MiB
250          webm       audio only tiny   74k , opus @ 70k (48000Hz), 1.47MiB
140          m4a        audio only tiny  130k , m4a_dash container, mp4a.40.2@128k (44100Hz), 2.92MiB
251          webm       audio only tiny  143k , opus @160k (48000Hz), 2.89MiB
394          mp4        256x144    144p   81k , av01.0.00M.08, 25fps, video only, 1.54MiB
278          webm       256x144    144p   99k , webm container, vp9, 25fps, video only, 2.14MiB
160          mp4        256x144    144p  110k , avc1.4d400c, 25fps, video only, 2.38MiB
395          mp4        426x240    240p  184k , av01.0.00M.08, 25fps, video only, 3.39MiB
242          webm       426x240    240p  230k , vp9, 25fps, video only, 4.90MiB
133          mp4        426x240    240p  245k , avc1.4d4015, 25fps, video only, 5.19MiB
396          mp4        640x360    360p  395k , av01.0.01M.08, 25fps, video only, 7.20MiB
243          webm       640x360    360p  418k , vp9, 25fps, video only, 9.03MiB
134          mp4        640x360    360p  633k , avc1.4d401e, 25fps, video only, 13.61MiB
397          mp4        854x480    480p  712k , av01.0.04M.08, 25fps, video only, 13.13MiB
244          webm       854x480    480p  774k , vp9, 25fps, video only, 16.75MiB
135          mp4        854x480    480p 1160k , avc1.4d401e, 25fps, video only, 25.45MiB
398          mp4        1280x720   720p 1456k , av01.0.05M.08, 25fps, video only, 26.20MiB
247          webm       1280x720   720p 1539k , vp9, 25fps, video only, 33.49MiB
136          mp4        1280x720   720p 2316k , avc1.4d401f, 25fps, video only, 50.46MiB
399          mp4        1920x1080  1080p 2492k , av01.0.08M.08, 25fps, video only, 45.96MiB
248          webm       1920x1080  1080p 2700k , vp9, 25fps, video only, 58.80MiB
137          mp4        1920x1080  1080p 4337k , avc1.640028, 25fps, video only, 91.16MiB
400          mp4        2560x1440  1440p 7468k , av01.0.12M.08, 25fps, video only, 143.60MiB
271          webm       2560x1440  1440p 8993k , vp9, 25fps, video only, 189.90MiB
401          mp4        3840x2160  2160p 14110k , av01.0.12M.08, 25fps, video only, 278.39MiB
313          webm       3840x2160  2160p 18006k , vp9, 25fps, video only, 387.17MiB
18           mp4        640x360    360p  734k , avc1.42001E, 25fps, mp4a.40.2@ 96k (44100Hz), 16.55MiB (best)

The following command:
youtube-dl -f 137+251  https://youtu.be/Xj3gU3jACe8

produces far better results than this usage:
youtube-dl -f 18  https://youtu.be/Xj3gU3jACe8 (marked as best)

There seems to be further bugs as trying to specify the height filters to limit to 1080p doesn't work. It still downloads the 4k variant (which notably is not that marked as best either)
youtube-dl -f "bestvideo[height<=1080,ext=mp4]+bestaudio[ext=m4a]" https://youtu.be/Xj3gU3jACe8

pi@rpi-lounge:~ $ youtube-dl --version
2020.06.16.1


dpkg: error processing package unity-tweak-tool (--configure) when i run apt-get install, apt-get upgrade, apt-get -f install, it always return this :

Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 0 to remove and 4 not upgraded.
1 not fully installed or removed.
Need to get 0 B/333 kB of archives.
After this operation, 0 B of additional disk space will be used.
dpkg: error processing package unity-tweak-tool (--configure):
 package is in a very bad inconsistent state; you should
 reinstall it before attempting configuration
Errors were encountered while processing:
 unity-tweak-tool

What's wrong? I try all command like apt-get remove, purge, clean and there is no effect and still return error.

[EDIT] i try to reinstall unity tweak tool, but it returns :

Reading package lists... Done
Building dependency tree
Reading state information... Done
0 upgraded, 0 newly installed, 1 reinstalled, 0 to remove and 4 not upgraded.
1 not fully installed or removed.
Need to get 0 B/333 kB of archives.
After this operation, 0 B of additional disk space will be used.
(Reading database ... 216695 files and directories currently installed.)
Preparing to unpack .../unity-tweak-tool_0.0.6ubuntu1_all.deb ...
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'
Aborted (core dumped)
dpkg: warning: subprocess old pre-removal script returned error exit status 134
dpkg: trying script from the new package instead ...
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'
Aborted (core dumped)
dpkg: error processing archive /var/cache/apt/archives/unity-tweak-tool_0.0.6ubuntu1_all.deb (--unpack):
 subprocess new pre-removal script returned error exit status 134
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
Fatal Python error: Py_Initialize: Unable to get the locale encoding
ImportError: No module named 'encodings'
Aborted (core dumped)
dpkg: error while cleaning up:
 subprocess installed post-installation script returned error exit status 134
Errors were encountered while processing:
 /var/cache/apt/archives/unity-tweak-tool_0.0.6ubuntu1_all.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

Run

sudo apt-get install --reinstall unity-tweak-tool

as recommended by the error message. You have probably deleted some of the files manually and broke the package.

you could try this:

sudo apt-get purge unity-tweak-tool
sudo -i
sudo apt-get update --fix-missing
sudo apt-get upgrade

and it might work fine this way.


Search text within multiple pdfs and docs I got a bunch of notes written by other students, but they are from an old textbook that didn't deal with everything in the same order, so I need to search through the notes for every chapter (each individual chapter is in a different .pdf or .doc) for "trace conditioning" for example.

I used to use Google Desktop for this, I have Launchy now and I told it to search pdfs, but it only searches the titles, not the content.

Thanks for any help.

Recoll is probably the most versatile document search engine you will find on Linux:

It supports a plethora of different formats and is very customizable.

For installation instructions and other pointers please check out this answer. The official documentation is very useful, too.

first download "wine" software in your desktop
In this win install seekfast as link given below
http://seekfast.org/download-seekfast
you can do your work
its working ,if its not then plz comment me


Cannot copy/cut and paste from file manager to Desktop on Ubuntu 20.04 LTS VIDEO
I cannot copy and paste files from the file manager to Desktop on Ubuntu 20.04 LTS. Is there a way to fix this issue?

The file manager window you have open has a "Desktop" entry in the left navigation bar. Drop your file there and it will appear on the desktop.

Unfortunately you are not running a Mac or Windows.
What you can do in the file manager, is copy the file and then navigate to the folder //home//Desktop and paste it there.


Automatically enter input in command line I'm running a script that it requests entering 'y' on each operation, I am looking for a solution like $ ./script < echo 'yyyyyyyyyyyyyy' to pass all my inputs in one time.

There is a command created specifically for that case: yes

$ yes | ./script

What this does is connect the output of yes to the input of ./script. So when ./script asks for user input it will instead get the output of yes. The output of yes is an endless stream of y followed by a newline. So basically as if the user is entering y for every question of ./script.

If you want to say no (n) instead of yes (y) you can do it like this:

$ yes n | ./script

Note that some tools have an option to always asume yes as answer. See here for example: Bypass the yes/no prompt in 'apt-get upgrade'

Other methods to enter input:

If you know exactly how many y your script is expecting you can do it like this:

$ printf 'y\ny\ny\n' | ./script

The newlines (\n) are the enter keys.

Using printf instead of yes you have more fine grained control of input:

$ printf 'yes\nno\nmaybe\n' | ./script

Note that in some rare cases the command does not require the user to press enter after the character. in that case leave the newlines out:

$ printf 'yyy' | ./script

For sake of completeness you can also use a here document:

$ ./script << EOF
y
y
y
EOF

Or if your shell supports it a here string:

$ ./script <<< "y
y
y
"

Or you can create a file with one input per line:

$ ./script < inputfile

If the command is sufficiently complex and the methods above no longer suffice then you can use expect.

Here is an example of a super simple expect script:

spawn ./script
expect "are you sure?"
send "yes\r"
expect "are you really sure?"
send "YES!\r"
expect eof

Technical nitpick:

The hypothetical command invocation you gave in your question does not work:

$ ./script < echo 'yyyyyyyyyyyyyy'
bash: echo: No such file or directory

This is because the shell grammar allows a redirect operator anywhere in the command line. As far as the shell is concerned your hypothetical command line is the same as this line:

$ ./script 'yyyyyyyyyyyyyy' < echo
bash: echo: No such file or directory

That means ./script will be called with the argument 'yyyyyyyyyyyyyy' and the stdin will get input from a file named echo. And bash complains since the file does not exists.

I was writing a bash script with Dialog and needed this to happen automatically also. I did this and it worked like a charm.

# -Wy force signaturewipe (if exists)
echo "y" | sudo lvcreate -W y -n $lvName -L "$lvSize"G /dev/"$svg" >> $nfsUtilLog


unmet dependencies libgphoto2-port12_2.5.14+201706200750~ubuntu16.04.1_i386.deb I've got libgphoto2-port12_2.5.14 errors while apt upgrade,
and they are not solved with apt -f install.
I did not installed anything new, just perform the routinary update, upgrade.
I saw other similar question on Unmet dependencies - libgphoto2-port12 but it is on hold and I cannot the level to comment.

Tried all their "solutions" without success including sudo apt-get dist-upgrade -f that solve to them.
My conf is:

$ uname -r
4.4.0-81-generic
$ lsb_release -a
LSB Version:    core-9.20160110ubuntu0.2-amd64:core-9.20160110ubuntu0.2-noarch:security-9.20160110ubuntu0.2-amd64:security-9.20160110ubuntu0.2-noarch
Distributor ID: Ubuntu
Description:    Ubuntu 16.04.2 LTS
Release:    16.04
Codename:   xenial

The offending error is:

$ sudo apt upgrade
Reading package lists... Done
Building dependency tree
Reading state information... Done
You might want to run 'apt-get -f install' to correct these.
The following packages have unmet dependencies:
libgphoto2-6:i386 : Depends: libgphoto2-port12:i386 (>= 2.5.10) but 2.5.9-3 is installed
libgphoto2-port12 : Breaks: libgphoto2-port12:i386 (!= 2.5.14+201706200750~ubuntu16.04.1) but 2.5.9-3 is installed
libgphoto2-port12:i386 : Breaks: libgphoto2-port12 (!= 2.5.9-3) but 2.5.14+201706200750~ubuntu16.04.1 is installed
E: Unmet dependencies. Try using -f.

If I try to force:

$ sudo apt -f install
....
(Reading database ... 438863 files and directories currently installed.)
Preparing to unpack .../libgphoto2-port12_2.5.14+201706200750~ubuntu16.04.1_i386.deb ...
Unpacking libgphoto2-port12:i386 (2.5.14+201706200750~ubuntu16.04.1) over (2.5.9-3) ...
dpkg: error processing archive /var/cache/apt/archives/libgphoto2-port12_2.5.14+201706200750~ubuntu16.04.1_i386.deb (--unpack):
 trying to overwrite shared '/usr/share/locale/fr/LC_MESSAGES/libgphoto2_port-12.mo', which is different from other instances of package libgphoto2-port12:i386
dpkg-deb: error: subprocess paste was killed by signal (Broken pipe)
Processing triggers for libc-bin (2.23-0ubuntu9) ...
Errors were encountered while processing:
 /var/cache/apt/archives/libgphoto2-port12_2.5.14+201706200750~ubuntu16.04.1_i386.deb
E: Sub-process /usr/bin/dpkg returned an error code (1)

I need help as I cannot install any package. If someone considers that this is not ubuntu related, please, let me know which is the suitable forum. Thanks

The libgphoto2-port122.5.14+201706200750~ubuntu16.04.1:{i386:amd64} versions was comming from ppa:mutlaqja/ppa not from ubuntu repository. I finally solved it myself by downloading directly 16.04 ubuntu stable versions from http://pkgs.org/download/libgphoto2-port12 with:

 $ wget http://archive.ubuntu.com/ubuntu/pool/main/libg/libgphoto2/libgphoto2-port12_2.5.10-3_amd64.deb
 $ wget http://archive.ubuntu.com/ubuntu/pool/main/libg/libgphoto2/libgphoto2-port12_2.5.10-3_i386.deb

Then, installing them with:

 $ sudo dpkg -i libgphoto2-port12_2.5.10-3_i386.deb
 $ sudo dpkg -i libgphoto2-port12_2.5.10-3_amd64.deb

Finally, I removed the offending ppa (temporary until bug solution) with:

 $ sudo add-apt-repository --remove ppa:mutlaqja/ppa

After, I reboot to clean cache and execute standards apt-get update and upgrade, without errors. Now I am free again to install new packages.

"libgphoto2-port12 : Breaks: libgphoto2-port12:i386 (!= 2.5.14+201706200750~ubuntu16.04.1)"

the 64 bit and 32 bit versions have to be the same.

either upgrade libphoto2-port12 to ver 2.5.14 or downgrade libphoto2-port12;I386 TO VER 2.5.9-3


Remove all packages installed from a PPA? I have installed LibreOffice 4 using PPA. I was using LibreOffice 3, then  I had upgraded to LibreOffice 4, because I was somewhat eager to try a new version.

Now since I found that LibreOffice 4 has some issues, including handling my native language, I want to move back to LibreOffice 3.

This question How to downgrade from LibreOffice 4.0 to 3.6? has already some answers which has some similarity with my above mentioned issue, but it does not solve my problem. This question talks about downgrading from a specific version of LibreOffice, namely from 4.0 to 3.6. The solutions mentioned are not the ones I am looking for. They will work, but the  solutions suggest either downloading .deb files for LibreOffice 3.6 or adding PPA for them. Furthermore, some of the answers put out-of-proportion~(applicable for the solution, however) stress on use of synaptic, not general command-line-solution.

I want a general solution without using PPA or downloading .deb files. All I want is to move back from the (higher) PPA version to the (lower) official version.

Anyway, in order to accomplish this, I removed the LibreOffice config directory from my home and then purged LibreOffice from my machine.

sudo apt-get purge libreoffice-*

Then I removed the relevant PPA's using the sudo apt-add-repository --remove command. And then ran sudo apt-get update.

Now, when I try to install LibreOffice using the command

sudo apt-get install libreoffice

I get an avalanche of output about unmet dependencies, something like,

The following packages have unmet dependencies:
 libreoffice : Depends: libreoffice-core (= 1:3.5.7-0ubuntu4) but it is not going to be installed
(snipped)

If I dig the issue further, by using the command,

sudo apt-get install libreoffice-core

I get

The following packages have unmet dependencies:  libreoffice-core :
Depends: libreoffice-common (> 1:3.5.7) but it is not going to be
installed
                Depends: libexttextcat0 (>= 2.2-8) but it is not going to be installed
                Depends: ure (>= 3.5.7~) but it is not going to be installed E: Unable to correct problems, you have held broken packages.

Could you please tell me how do I install LibreOffice 3 in my machine?

I am using Ubuntu 12.04 LTS.

EDIT

Before receiving the accepted answer, I was wondering, at this very moment, if I take a fresh computer, and install Ubuntu 12.04, LibreOffice installation will work without a hitch. Then why I can not install LibreOffice in my 12.04 machine today from simple command line?  Then the accepted answer clarified everything. I need to use ppa-purge so that this resets all packages from a PPA to the standard versions released for my distribution.  Basically it is like a way to restore my system back to the way it was before my installed packages from a PPA. This article further elaborates the idea.

The above mentioned answer worked perfectly for me. Actually, this was an education for me since it taught me how do downgrade a package that was added via PPA. And I realized that the answer actually teaches us to "move from PPA installation  of a package to official lower version package."

You need the ppa-purge utility to downgrade all the packages installed by the PPA and disable the PPA.

Since you have removed the PPA from your sources list, you have to add it back.

Then, run:

sudo apt-get install ppa-purge
sudo ppa-purge ppa:<your_ppa_name_here>

Then you can install LibreOffice 3 from the official repositories.

Regards.

Open Terminal To Remove Previous LibreOffice Installation

Copy & Paste Command:

sudo apt-get remove libreoffice*.*

Press Enter

Download LibreOffice From Website

Right Click & Extract LibreOffice Folder

Rename It libreoffice

Cut & Paste To Desktop

Go Into DEBS Folder

Right Click & Select Open In Terminal

Copy & Paste Command:

sudo dpkg -i *.deb

Press Enter

LibreOffice Is Now Installed


Chown and chmod in ubuntu with different applications using common files I'm having problems with chown and chmod in ubuntu 18.04.
When I use php + nginx:
touch ('/var/www/a.log');
user:own of a.log is nginx:nginx and chmod is rw-r-r--
when i use

shell_exec('ffmpeg -i' b.mp3 >a.log 2>&1');

The above command was not able to run because it does not have access to the a.log file, it seems that ffmpeg was running under user ive (this is my ubuntu login account). It could not write to the log file. I hope you will give me advice to handle this case. I am using ubuntu 18.04 on my laptop.
p:s I was thinking of a root login solution so that all commands run with root but not yet. When logged in with root at the ubuntu login screen. Although I have entered the correct password, it still gives me the wrong password. :(

At first, add your user into nginx group:

sudo usermod -G nginx ive

And then add this line after your touch(); function:

chmod("/var/log/yourlog.log", 664);

Use groups for what you are trying to do.
You can't use root to login because as stated here

  By default, the root account password is locked in Ubuntu.

The password you used in sudo is not the password in root.


Admin password will not respond I have Ubuntu 16.04 LTS.  Computer was fine yesterday afternoon, but when I fired it up in the evening it kept asking me for my admin password.  What I typed in was correct - many times.  I just can't get into my computer! It's not a new computer. Please advise. I am using my employer's laptop to write this.

Hello my computer keyboard is English and very old (the letters are fading on it)  I'm sorry, I don;t know what encrypted means.  I am just a typist (not a very good one on this laptop!)

Arijit - I'm sorry, I clicked on "him" to thank you and say was doing what you suggested and it has taken me to a website.  Could you please re-send your instructions again.  They seemed easy to follow but your post has disappeared!

Hello again Arijit - I realised what I have done - no need to re-send!  This is a struggle for me.

@Melanie:
1. Boot into recovery mode from the Grub menu (using shift key if Ubuntu is the only OS)
2. After the boot, go to the option Drop to Root Shell Prompt
3. Type mount -o rw,remount /
4. To reset Password, type passwd username (your username)
5. Then type a new Password and exit from the shell to the recovery menu
6. Select resume normal boot
7. Select Ok
8. Use your Ubuntu with the new Password

Regards

You may Thank him for the solution.


Ubuntu 13.10 - no USB devices after restart I have a fresh install of ubuntu 13.10. I was trying to install wine and it hung up so I decided to restart the computer instead of killing processes at random (no, I didn't kill any processes). After reboot the keyboard (USB) doesn't function so I can't log in. USB wireless adapter is also down as is the USB mouse. I then installed 13.04 on side and it works just fine. Now the question is, how do I fix the 13.10 installation or should I just delete it and install 13.04 in it's place?

What I would do is uninstall 13.10 and then do a reinstall. Most likely what happened is that Wine was in the middle of gaining access to USB devices so it could use your mouse and keyboard when you shutdown the computer and then the drivers got corrupted.


How to remove unity 2d workspace animation? Unity 2d's workspace animation runs very slowly on my old graphics card. How do you disable them?

You can set transitionDuration = 0 in the file /usr/share/unity-2d/spreed/utils.js.

Probably the best solution is to log in with the "Classic Gnome Desktop" (drop-down menu is at the bottom of the GDM Greeter after selecting your username). This will avoid Unity completely.


New ext4 partition and used space I have a fresh ext4 partition, which means I just formated it with mkfs.ext4 -m 0.1 /dev/mapper/abak-home, and there's already 27G space used. Setting reserved root space (-m) to 0 didn't have any effect.

I'm using LVM but I don't think that LVM should have any effect on this. Ubuntu version is 12.04 LTS.

# df -h
Filesystem             Size  Used Avail Use% Mounted on
...
/dev/mapper/abak-home  1.8T   27G  1.8T   2% /home

Then I tried formating partition with ext3 and the result is much better:

# df -h
Filesystem             Size  Used Avail Use% Mounted on
...
/dev/mapper/abak-home  1.8T  196M  1.8T   1% /home

Anyway, why the difference and how can I fix this?

There's nothing to fix, and this is perfectly normal.

ext4 creates a lot of overhead before any files are created. It does not mean it is "worse" than ext3. If you fill that partition with files, you will notice that ext3's (and NTFS's) overhead will grow proportionally with the files, as with ext4 it will basically remain constant forever.

By "pre-allocating" the overhead, it can manage it much better than a growing one. So ext4 is just doing now what ext3 would do later.

Besides, 27G may look a lot, but it's still a mere 1.5% overhead. Compare that to the old days of FAT, where slack space could eat anything from 5% to 30% of your partition space, and you'll notice how greatly things have evolved since then.

Also, I strongly recommend against using -m 0. Reserved space is there for a reason: it lowers the fragmentation chances and saves some space for fsck. It is reserved only from users, but root (and thus all your software installs) can fully use it. If you think 5% is excessive, leave at least 1% .

Remember: there's no fragmentation nightmares in ext. But this beauty comes at a price. It needs free space as room for proper management. Give it to him and things will run much smoother. Besides, who ever uses their HDD beyond 90% before buying a larger one? So what's the problem about a 5% reserved space? It may save you the next time you accidentally create a dozen-GB file that fills up the whole partition and end up crashing the OS due to lack of space for other processes.

For a more detailed, further technical reading, read here

Use df -H instead. The difference you see is because of the difference in real GBs/TBs (factor of 1024) and sales men's GBs/TBs (factor of 1000).


How to delete a partition that is locked I wish to delete a partition of Linux Mint. I am familiar with Gparted and using a live cd, but it is locked. It says extended /dev/sda2. Here is a screenshot of my partitions:

  Thank you all for your help in advance.

If it's THE extended partition, you can't delete it without removing all the logical partitions in it.

You need to unmount all partitions in the extended partition that may be mounted.

In your case, you need to unmount swap partition. Right-click on it and choose unmount. Then proceed.

You can't delete or move partitions that are mounted. If you don't want to delete a system partition, where your working system is installed, then right-click it and choose "unmount". If you want to delete a system partition, then you will have to boot from some other drive, like LiveCD.

If your linux Mint is on sda6 prtition, then just delete it.


wget to get a file generated by a php script I am trying to get a file generated by the php script export.php. But using this command, I am either getting 403 Request Forbidden or downloading the script itself instead of a .csv the script is supposed to generate. If I visit the link manually on Chrome, the download starts automatically and the csv file is downloaded

wget -U Chrome http://proto.agrech.com/export.php

Solved by getting the CURL command to go from the browser to download the .csv


Back up failed error in Ubuntu 18.04 I just upgraded from Ubuntu 16.04 LTS to Ubuntu 18.04 following instructions as it appeared on the screen.

I am facing a back-up failure with the following error.

Error processing remote manifest (duplicity-inc.20180923T095052Z.to.20180927T050242Z.manifest.gpg): GPG Failed, see log below:
===== Begin GnuPG log =====
gpg: WARNING: "--no-use-agent" is an obsolete option - it has no effect
gpg: starting migration from earlier GnuPG versions
gpg: porting secret keys from '/home/abhilash/.gnupg/secring.gpg' to gpg-agent
gpg: can't open '/home/abhilash/.gnupg/secring.gpg': Permission denied
gpg: AES encrypted data
gpg: encrypted with 1 passphrase
===== End GnuPG log =====

So, I have managed to fix this issue, where the backups procedure cannot look at your local files in gnupg, due to read rights. You need to change these rights, per the following post.

https://superuser.com/questions/954509/what-are-the-correct-permissions-for-the-gnupg-enclosing-folder-gpg-warning

I had to use 'sudo' in order to be allowed to do this by my installation. Then there are the two other commands:

sudo chown -R $(whoami) ~/.gnupg/
find ~/.gnupg -type f -exec chmod 600 {} \;
find ~/.gnupg -type d -exec chmod 700 {} \;

I wrote my backup to a new folder on my external drive.


Not possible to use Bluethooth Headset with A2DP (High Fidelity) and Microphone simultaneously I am using Ubuntu 17.04 with Gnome shell.

Is it possible to connect a bluethooth headset (Sony MDR-ZX770BN) but not to set High Quality (A2DP) inside Pulse Audio Control and put on the microphone simultaneously?

Every time I switch to the microphone of the headset the quality of the speakers changes to low-quality (HSP/HFP).

How can I switch A2DP on and make the microphone work together?

I tried everything i possibly could, ofono and phonesim too. But i couldn't use the microphone of my headset. So i discovered another way to use a mic.
All you need is an Android phone which has bluetooth.
Firstly, go to google playstore on your phone and download a bluetooth microphone app.
I used this one (Simple Bluetooth Mic): https://play.google.com/store/apps/details?id=com.app.google.chrischan.simplebluetoothmic
Alternatively, you can use this: https://play.google.com/store/apps/details?id=wimlog.com.myandroidtest4.
Connect the phone's bluetooth to your PC.
Now connect your bluetooth headset to the PC. (Both the devices must be connected simultaneously)
Open the Simple Bluetooth Mic App on your phone, click on speak.
Voila, that's it.
Basically you are using your phone's mic, because we can't use the bluetooth headset for both audio input and output.(even if it works for you, changing from A2DP to HSP everytime you need to use the headset mic is ughhh)
If this doesn't work, go to your sound settings and choose the input device as your phone's bluetooth.
HOPE THIS HELPS :)

This "problem" is implicit bluethooth (BT) profiles by design:

a2dp-> hd audio, no input

HSP/HFP -> low audio with input

There is no profile with hd audio with input.
The limit is the throughput of bluethooth.
a2dp uses the full throughput for hd audio output (device 2 headphones)
HSP/HFP uses half for playing audio half for mice (device 2 head set,head set 2 device)

someone created a script for linux to swich between the two:

How to keep the audio profile at A2DP while using a mic with Bluetooth headset? (Push-to-talk)

His script shared on github:
https://gist.github.com/OndraZizka/2724d353f695dacd73a50883dfdf0fc6

the situation my be different with BT 5, but would need BT 5 on both ends  device and head set. BT 5 has a bigger throughput witch could enable hd audio and mic at the same time, but i was unable to find anything on that regart

My understanding is that some proprietary extensions provide the needed functionality. Ex.: aptX Voice uses an advanced codec to provide better audio and mice support...


Ubuntu installation hangs at partition menu Hello guys I'm trying to dual boot ubuntu on my ssd with windows 7 64 installed. I had already reserved 40gb free space for it in advance. I tried to install both 14.04.1 and 12.04 with no success. The both  hang at the partition menu. Any suggestions?

edit:

Ok so I managed to get this during an installation attempt.

http://oi61.tinypic.com/rlidqe.jpg

If you are installing Ubuntu desktop, it will sense the windows partition, then ask you if you want to keep the windows partition, and install Ubuntu alongside, or delete the windows partition, and use the whole disk for Ubuntu. After answering this question, you should be able to use the default disk partition it provides, and not go into the partition menu at all.


Is using Ubuntu 10.10 still a viable option? I fell in love with Ubuntu when version 10.10 (Maverick Meerkat) was released. I want to stick to it, since I like it a lot more than the 11 and 12 series.

(2011/11 Series: 11.04 - Natty Narwhal, 11.10 - Oneiric Ocelot | 2012/12 Series: 12.04 LTS - Precise Pangolin, 12.10 - Quantal Quetzal)

My question is, since its not currently supported (support ended on April 10, 2012), what problems will I face?

  Will I be eligible for distibution upgrade? (e.g. from 10.10 to 11.10) I mean at least until the next Ubuntu distribution was supported
  Can I somehow get security updates and patches?
  Will the latest software still be available on Ubuntu 10.10? I don't care much about drivers, I care about Python, PHP, Apache, Wine and other software.
  Will the Ubuntu Software Center work, and will there be updates?
  What issues am I most prone to face?

It would be better if you installed Ubuntu 10.04 because Canonical will support it with updates until April 2013. I myself hated Ubuntu 11.10 because of its glitches, but then i did a fresh install with 12.04 and I'm loving it so far.

Installing anything older then 10.04 is completely unnecessary because there is no support along with it. Also if you are a person who likes old versions so much and you wont mind using Ubuntu server edition, you can try Ubuntu 8.04 Server Edition. It will also be supported by Canonical until April 2013. Make your choice, and good luck.

I understand what you mean when you say that 11 and 12 went the wrong way. I once tried switching back to 10.10, however, I had to look for another distro for the following reasons:

Not possible to update anymore (it seemed as if I couldn't even get the updates for the 10.10 version)
New programs will not necessarily work as some of them may need certain library versions, while the existing ones are out-of-date.
It's much more worthwhile to return to 10.04 for the time being. As long as you want to keep away from the newer 11 and 12 Ubuntus (avoiding bloat is always a good idea), the LTS Lucid Lynx will serve your needs well for a year or so.

If you wish to stick to a stable distro, I recommend choosing something of a more lightweight nature, such as some debian-based distro. I myself am using Crunchbang and I can easily recommend it to anyone - the current stable release doesn't really differ at all from the testing branch (yes, it's a debian-based linux) in terms of appearance and performance (around 80 MB of RAM used on startup), therefore it is easy to notice that this is much more stable - unlike mainstream Linux distributions, such as Ubuntu, which are always trying to catch up with the trends.

Crunchbang is just an example, you may wish to review the lightweight versions of Linux Mint (namely LXDE desktop) or others which also give you a choice of a more resource-hungry desktop. Recommendation: stick to lightweight window managers as they are stable, do not consume much resources (if any at all given today's computers' specs) and, if configured right, look rather elegant with minimal compositing and a nice GTK skin (that is why I use crunchbang, it has a default selection of great themes).

To add to 10.10, it's kernel version is a bit dated and you would probably want either the latest 2.6 release or the 3.x kernel (10.10, as far as I remember, uses the older 2.6 release).


Cannot boot from USB or BIOS, grub rescue I accidentally deleted my Linux partition from Windows, and when I restarted I always see the grub rescue screen. I did try setting root to each of the partitions, but I always got the unknown filesystem error. I found that the most suggested fix is to boot from a live CD/USB, but I can't perform that as well.

Try to Boot from live Ubuntu CD/USB, Install GRUB2 in proper Partition
To fix the problem.

this link fix my same problem.
https://help.ubuntu.com/community/RecoveringUbuntuAfterInstallingWindows

or if not correct it see
http://howtoubuntu.org/how-to-repair-restore-reinstall-grub-2-with-a-ubuntu-live-cd

to manually install GRUB2 in Terminal.

You are getting a error because grub cannot find the linux. You need to boot into BIOS and manually select the boot option (USB). Once you do that re-install linux and it should update your grub config so that the new linux will be loaded


I deleted ubuntu and now I can't boot into windows! This error comes up everytime

failed to load image grub error efi
failed to start image

Then I get redirected to boot menu and every option has the same effect i.e the same error. I even tried inserting a recovery drive through usb and it resulted in the same error.

https://imgur.com/a/iyxwuLs

https://imgur.com/a/YUAtKWs

you have to do a startup repairing for windows.

you can boot your system using a windows DVD and do a startup repair.see here and here

Try Boot Repair from Ubuntu Live session.

More info can be found here: https://help.ubuntu.com/community/Boot-Repair.

Hope it helps.


Google Chrome proxy settings? When I try to set Google Chrome's proxy settings (on chrome://linux-proxy-config/), I get the following message:

  When running Google Chrome under a supported desktop environment, the
  system proxy settings will be used. However, either your system is not
  supported or there was a problem launching your system configuration.

  But you can still configure via the command line. Please see man
  google-chrome-stable for more information on flags and environment
  variables.

I need to set proxy settings to use Chrome, but I don't want to be setting them in the command line every time I use Chrome. Is there a way to set these settings permanently?

Also, is there an option in Chrome so that it doesn't use proxy for specific domains (analogous to the No proxy for setting in Firefox)?

Open a Terminal and type sudo -H nautilus
Type your password then press Ctrl+L and type /usr/share/applications/ and press Enter
Now find google-chrome and right-click on chrome icon and select "Properties".
Next, Add the following option at the end of command text box, there.
--proxy-server="IP proxy Server:port" (ex: --proxy-server="127.0.0.1:8080")
it's look like this (it's the same for Chrome):

close the window and if the chrome browser is still running, then close the browser and restart again. Finally you can use chrome browser with proxy.
--proxy-bypass-list:
If you want to tell google-chrome to NOT use a proxy with specific domains use --proxy-bypass-list command. This command specifies a list of hosts for whom we bypass proxy settings and use direct connections. Ignored if --proxy-auto-detect or --no-proxy-server are also specified. This is a comma-separated list of bypass rules.
Here is List of Chromium Command Line that used in google-chrome too.

/usr/bin/google-chrome-stable %U --proxy-server="socks5://127.0.0.1:9050" --host-resolver-rules="MAP * 0.0.0.0 , EXCLUDE 127.0.0.1"

See here: https://superuser.com/questions/321804/manually-configuring-proxy-settings-of-google-chrome-on-ubuntu


Sound Volume after boot always at loudest level I installed 10.04 a couple of weeks ago. My primary OS is Windows and i could not install Linux up until very recently because of lack of hardware support for my notebook.

10.04 is the only distribution that i managed to get to install on my notebook, but my problem is, that even though i set the volume at a low level, every time after booting and login into Ubuntu, the sounds will play at the highest volume. The volume indicator will still show the low volume setting, but sounds play at the highest volume until i click the volume setting again manually

Is there a config-file i need to update to fix this, or is it a known bug?
Anybody had the same problem?

Please try this approach - it might help.

I think this issue is related to a known bug, that is already in proggress: https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/206315


What is a terminal and how do I open and use it? What is a terminal?
How do I open a terminal window?
How do I use the terminal?

What is it:

The terminal is an interface in which you can type and execute text based commands.

Why use it:

It can be much faster to complete some tasks using a Terminal than with graphical applications and menus. Another benefit is allowing access to many more commands and scripts.

A common terminal task of installing an application can be achieved within a single command, compared to navigating through the Software Centre or Synaptic Manager.

For example the following would install Deluge bittorrent client:

sudo apt-get install deluge

To save a detailed list of files in the current directory tree to a file called listing.txt:

find -type f > listing.txt

Sometimes you will also see the following notation:

$ whoami
calum
$ ls
Downloads  Documents

This means that the command whoami is executed which gives calum as output. Following that command, ls is executed which outputs Downloads  Documents.

A similar notation is:

# apt-get update

This means that the command should be run as root, that is, using sudo:

$ sudo apt-get update

Note that the # character is also used for comments.

# this command will give your username
whoami
# the next command will show the contents of the current directory
ls

How do I open a terminal:

Open the Dash (Super Key) or
Applications and type terminal

Use the keyboard shortcut by pressing Ctrl+Alt+T.
For older or Ubuntu versions: (More Info)

Applications → Accessories → Terminal

Alternative names for the terminal:

Console
Shell
Command line
Command prompt

(Although technically they mean different things)

Common commands & Further information

Ubuntu Documentation: Using The
Terminal

Simply said, a Terminal is a CLI (Command Line Interface) to interact with programs in the computer.
In Ubuntu you can open a terminal:

by pressing Ctrl+Alt+T

or

by pressing the Super key, type "terminal" and then hit Enter.

You can use the terminal for various tasks, such as:

Installing, updating, and deleting software.
For power off, reboot, sleep...
Creating and removing files and folders.
Many more...


What version of OpenGL does G++ have? I'm going to buy an OpenGL book from Amazon but there are different versions for OpenGL 2, 3 and 4. Which one does G++ use?

g++ is the C++ compiler of the GNU Compiler Collection (GCC).
The compiler itself does not come with any OpenGL library.

You download OpenGL development libraries from the repository then you compile your program.

To get the OpenGL development library is in the package libgl1-mesa-dev. It has support for OpenGL 2.1 and some of the extensions from OpenGL 3. The next version of Mesa will likely support OpenGL 3.

To fetch it run sudo apt-get install libgl1-mesa-dev.

I'm thinking there are no OpenGL1; 2; 3; 4..
I only now OpenGL; OpenHL; OpenCL; OpenAL; OpenClusterGL; OpenXL.
But: Open__ is only a special 3D-Renderer. So you can config it whit the videocart-driver.
I'm not shure and information are from the Internet, so.....NO WARANTY!!!


How do I login to Ubuntu Snappy Core? I just configured Ubuntu Snappy Core on my Raspberry Pi 3 and now it is now asking for a user name and password in the terminal (I think). It says:

Ubuntu Core 16 on <my ip address> (ttyl)
localhost login:
Password:

I'm not sure whether these fields are for your Ubuntu account username and password or email and password or whatever. I've tried my Ubuntu account username and password and I also tried it with my email and password. Neither worked so I tried leaving them blank which also didn't work.

Is there some default password or did I put it in earlier and if so when or where? If I knew that I might be able to remember what I put.

Ubuntu Core 16 does not come with a default user name and password. Ubuntu Core requires you to setup a Ubuntu SSO account with your SSH keys, which enable you access to your device. Once in, you can create your own user. Please find the relevant instructions here.

Check that you're typing your username exactly as it should be (including case), by comparing it to the output of whoami run in a terminal.

Probably the keyboard layouts configuration is wrong fo the tty (which is a different setting than Xorg / Unity) and your password is wrong because of this.

Make sure you're typing the correct password by first typing it in the login field where you can see if it's being written as expected.

If the keymap is the case then try to rebuild it with command:

sudo dpkg-reconfigure console-setup

And reboot before the next try.


not able to run "phablet-flash -b -l" and so install ubuntu touch on my galaxy nexus Android Debug Bridge version 1.0.31
sdk updated.
Someone tell to change adb secure line from 1 to 0. if this is the solution, please tell me how to do it! android version 4.2.2
many thanks!

Read this, that should help. Have a nice day!
http://www.wugfresh.com/faq/how-to-fix-adb-device-is-listed-as-offline-on-android-4-2-2/


Is it possible to burn to multiple CDs at once (with a GUI)? I have a minor dilemma, in that I need to be able to burn multiple CDs at once, but with a GUI.

I'm no longer using the system I was when I first wrote this question, and since then circumstances have changed somewhat. I still need an application (a modern one, preferably) that can do this job for me. It has to be able to burn to multiple drives at the same time.

Preferably, it should also be capable of burning audio. Is there nothing for Linux that can do this that isn't ummaintained and impossible to use?

There is a project named qmultirecord:

http://linux.softpedia.com/get/Utilities/qmultirecord-101896.shtml

which promises to do this on top of my burn program
cdrskin. I did not test it myself, because i am a
command liner.

Is it really that hard to create one or two scripts
which the kids can start from icons or by easy to
memorize command line words ? (Kid brains are very
elastic, aren't they ?)

As for the scruples of coteyr: There is no obstacle for
doing this in principle. Occasionally i burn with two
drives while having another two drives reading for
verifying. (I have 2 PATA, 1 SATA, 3 USB.)

A burn backend, that automatically scans for all drives
before burning, would be quite hostile towards other
users of the system and get bad critics from multi-user
sysadmins. Some GUI burn programs might indeed do this.

Bad would be PATA attached drives which share the same IDE
controller (e.g. on older Linux: hdc and hdd). But PATA
is becomming rare.

Another obstacle is the fact that burning is a synchronous
userspace process. We do not have the priorities which the
kernel can use and we have to wait for each WRITE command
to end, before we can send a new one. The kernel can queue
multiple such commands without waiting for the first to
finish. So you need some CPU reserve for good reactivity.

Further your hard disk will have to jump between the two
data sources from which the burn processes read. I am
sure that my olde system would not be able to feed two
DVD burns with 20x speed (27 MB/s each).
But hey, even 40x CD speed is just 6 MB/s.

Have a nice day :)

Thomas

TurboJet CD/DVD Duplicator will allow you to burn multiple disks. TurboJet is a cdrecord back-end written in Qt for using multiple CD burners at once. Watch Turbojet2 DVD ISO Burning on multiple drives tutorial Ubuntu Linux.


How do I move back to original directory? First i did pwd, it says:

/home/user

I changed my directory using :

cd /Italic/Food/Places

Now, I want to go back to original directory: /home/user. How can I do this?

To cd to the previous directory, you can use one of the following commands in bash:

cd -
cd "$OLDPWD"

To cd to your home directory, use one of:

cd
cd ~
cd "$HOME"

If you want to undo multiple cds, cd can't help you. You'll have to use the pushd and popd commands. Instead of cd foo/bar, do

pushd foo/bar

Then you can use the popd command to undo as many times as you have used pushd.

Example:

/tmp/lightdm-1.10.5 $ pushd ~
~ /tmp/lightdm-1.10.5
~ $ pushd devel
~/devel ~ /tmp/lightdm-1.10.5
~/devel $ popd
~ /tmp/lightdm-1.10.5
~ $ popd
/tmp/lightdm-1.10.5
/tmp/lightdm-1.10.5 $

Also see:

How do I use the pushd and popd commands?

cd ~ will work. ~ is basically a shortcut for /home/user. If cd ~ takes you to the home folder, then use cd ~/user instead.


Trying to do ssh authentication with key files: server refused our key I'm trying to setup ssh authentication with key files in stead of username/password. The client is a Windows box running PuTTY and the server is a Ubuntu 12.04 LTS server.
I downloaded puttygen.exe and had it generate a key pair. In /etc/ssh/sshd_config I have this line:
AuthorizedKeysFile %h/.ssh/authorized_keys

and on my client's public key file it says this:
---- BEGIN SSH2 PUBLIC KEY ----
Comment: "my@email.address.com"
ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEAr3Qo6T5XU06ZigGOd3eKvfBhFLhg5kWv8lz6
qJ2G9XCbexlPQGanPhh+vcPkhor6+7OmB+WSdHeNO652kTofnauTKcTCbHjsT7cJ
GNrO8WVURRh4fabknUHPmauerWQZ6TgRPGaz0aucU+2C+DUo2SKVFDir1vb+4u83
AV1pKxs=my@email.address.com
---- END SSH2 PUBLIC KEY ----

I copied the part from "ssh-rsa AAA" to "my@email.address.com" and put that in the file ~/.ssh/authorized_keys on my server (in my own homefolder). In PuTTY under Connection > SSH > Auth I entered the path to the private key it generated on my client and saved the session settings.
I restarted the ssh server with
sudo service ssh restart

Now if I load the profile in PuTTY (I verified the private key is still in Connection > SSH > Auth and that the path is correct) and run the profile, it says
Server refused our key

I tried putting the public key in a file under the directory ./ssh/authorized_keys/ but that didn't help so I used ./ssh/authorized_keys as a file, pasting the key in it. I also tried generating a private/public key pair on the server, putting the public key in ./ssh/authorized_files and loading the private one in PuTTY on my client. Rebooting the server didn't help either.
I found that the error may be solved by putting the key in a place outside the user's home folder but that's only useful if the home folder is encrypted, which this one is not.
Also tried generating a 4096 bit key, thinking perhaps 1024 was too short.
How can I get this to work? Thanks!
EDIT:
Ok, /var/log/auth.log said:
sshd: Authentication refused: bad ownership or modes for directory /home/vorkbaard/.ssh

Google tells me ~/.ssh/ should be 700 and and ~/.ssh/authorized_keys should be 600, so I did that. Now /var/log/auth.log says:
sshd: error: key_read: uudecode AAAAB3N [etc etc etc until about 3/4 of my public key]

Ok, it is fixed however I don't see how this is different from what I tried already.

What I did:

generate a key pair with puttygen.exe (length: 1024 bits)
load the private key in the PuTTY profile
enter the public key in ~/.ssh/authorized_keys in one line
(ssh-rsa {your_public_key} with no more than once space between ssh-rsa and your key)
chmod 700 ~/.ssh
chmod 600 ~/.ssh/authorized_keys
chown $USER:$USER ~/.ssh -R
change /etc/ssh/sshd_config so it contains AuthorizedKeysFile %h/.ssh/authorized_keys
sudo service ssh restart

For troubleshooting do # tail -f /var/log/auth.log.

Thanks for your help!

In fact, I changed authorized_keys's permission to 644, then problem solved.

chmod 644 ~/.ssh/authorized_keys


Launcher, top Panel, and window decorations missing after 12.04 upgrade I upgraded from 11.10 to 12.04 and now my launcher is missing. I opened terminal using CTRL+ALT+T and the menu shows but the GUI (bar) window decorations above that is missing.

Things like CTRL+TAB and image previewer don't work. I've tried whats mentioned here but no luck.

Another Screenshot of my GUI looks :

First, try sudo apt-get -f install && sudo apt-get --reinstall install unity

Then, try unity --reset, followed by unity --replace; try doing this from the desktop and also from the console (switch via Ctrl-Alt-F1).

Go to monitor Preferences:
Select same image in all monitors


Just installed Ubuntu on my Nexus 10... how do I get to a bash terminal? I just installed the Touch preview on my Nexus 10. It is not at all what I expected. I thought it would be just like my desktop; I'm not at all interested in the "experience"... all I want is a bash prompt :) Is this possible, or have I totally misconstrued what Canonical intended to provide?

To my knowledge, a bash prompt is not included by default.


Mouse snapping back to upper right hand corner I am running Ubuntu 14.04 LTS on a Lenovo Erazer x510 desktop.  The mouse wants to be in the upper right hand corner of the screen. You can move it but it just snaps back into the corner.

I tried

sudo modprobe -r psmouse
sudo modprobe psmouse

and this works, but after about 2 or 3 minutes the mouse starts acting up again.

It also does it from the Live CD

I have tried different USB ports, and I am unable to even open terminal when in Unity. Even with the mouse unplugged, it is acting as there is one clicking.

sudo lightdm didn't help

I also have a Lenovo Erazer X510, and I had the same problem
both in Ubuntu 14.04 and Mint 17.1.  Since this machine doesn't even
have a ps2 mouse (or touchpad), I simply enter the psmouse removal command alone:

sudo modprobe -r psmouse

and this seems to have cleared up the problem -- the usb mouse is still working, and the erratic behaviour has gone away.

To make the change permanent, I added the line:

modprobe -r psmouse

to the file "/etc/rc.local", just above the line

exit 0

So far, so good.
I hope this helps!

Maybe you could create a script which runs the code: "sudo modprobe -r psmouse
sudo modprobe psmouse" continuously. Because earlier the question descriptions said "and this works, but after about 2 or 3 minutes the mouse starts acting up again.". Hope this helps!


Makeinfo package not found in 12.04 Please can anybody give me an answer for this? I have already tried:

sudo apt-get install makeinfo textinfo texi2html

But, I still get the error:

Unable to find the pacakge.

If you would have executed makeinfo directly, it would have suggested you the right package name:

$ makeinfo
The program 'makeinfo' is currently not installed.  You can install it by typing:
sudo apt-get install texinfo

After installing the apt-file package, you could also locate it with apt-file:

$ apt-file search makeinfo
...
texinfo: /usr/bin/makeinfo
...

Searching for "makeinfo" on packages.ubuntu.com would give the same information as apt-file.

Open a terminal and enter

sudo apt-get install makeinfo texinfo texi2html

Note that makeinfo has been removed.


Minimal Ubuntu 12.04 for programming I'm new to linux, I've windows 7 installed side by side with Ubuntu 12.04. I want to use Ubuntu for the sole purpose of programming and for that I've already removed many programs which I don't need For eg. Evolution, Media Players, etc.

Things I need for survival are:

Chrome
Python
GCC
PDF reader
Vim
Synaptic Package Manager

I seriously don't need anything else, but while removing some programs for eg. "The sound recorder", it says it'll remove "The Ubuntu Desktop system" as well, is it safe to remove it?

The Window Manager is still heavy on the graphics and there are still a lot of programs which I don't use and never will.
Is there any way to make it less graphic intensive like for example "Windows classic mode", and remove the heavy graphic versions all together.

Also I don't want to start from scratch as I've a slow internet connection and downloading packages and updates again will take a lot of time.

By graphics heavy I want to add the following as well

The touch pad is slow, I don't know slow or not smooth.

You can try Lubuntu, as is the Ubuntu distro with the lowest requirements. LXDE is very similar to classic Windows (95-7), adding some interesting features (such multiple areas), so it's perfect for development.

Lubuntu comes with the following things that you want:

Chrom(ium)
Python
PDF reader
Vim (without help)
Synaptic

Just install GCC with sudo apt-get install gcc (or the version that you want), and you're ready to work! ;)

I recommend the Bodhi distro of Ubuntu if you are beginner.

You Forgot: Acpid, alsa, ubuntu-restricted, laptop-mode, graphics driver, gsynaptic
Desktop Environments: Openbox (remember Obmenu), lxde, fvwm

Gvim > vim
Chromium > Chrome.
Evince > PDF reader

Add to list:
eterm - (Decent I suppose)
pcmanfm - (Rox-filler is lighter I think)
xarchiver- (billions of file systems, compressions, and stuff yet unknown/created)
vlc or minimal mplayer setup (Programming tutorials)

Mods:
remove apparmor
hacked up sysctl.conf
preload
local dns cache
ck patched kernel repo
x-swat repo for latest video drivers


How do I convert a MBR drive (encrypted LVM or unencrypted LVM) to GPT in Ubuntu? The Ubuntu installer defaults to a MBR drive setup when a UEFI BIOS isn't detected (such as when the hardware doesn't support EFI/is too old). It still uses LVM as the automatic partition scheme.

In Fedora there's a way to force the installer using a boot flag (inst.gpt) to create a GPT drive with LVM.

There's not currently a way to do this on Ubuntu so how do I convert the MBR drive to GPT with a LVM scheme, post-install? Currently the only documentation I have found (http://www.rodsbooks.com/gdisk/mbr2gpt.html) does not cover LVM setups (encrypted or not).

The setup I am attempting this on is Ubuntu 16.04.6 on a Dell Latitude E6400 (manufactured in 2009, it doesn't have EFI) but this would apply to any non-EFI system where the user wants to use GPT rather than MBR. Currently what happens when I run the installer and choose LVM (encrypted) is that the installer creates the scheme with MBR.

While some of what the answer here says may apply https://askubuntu.com/a/85857/39237 it does not cover LVM (encrypted or not).

Please note the answer I'm looking for doesn't necessarily need to cover encrypted LVM setups (it may not even be possible, but i am not 100% certain on this yet). An answer that covers an unencrypted LVM setup would be okay.

All you have to do is remove the old table (which doesn't break filesystems, but does break bootloader), then make a new one, with the same start sectors for all partitions with data (lvm, filesystems, etc.).

You could probably do this in the running system, but you'll get warnings and errors (on redhat distros, gparted is patched/configured to be idiot proof and stop you, but sgdisk and probably gdisk works). You should do it in a LIVE or rescue boot.

the new partitions must start exactly on the same sector as the old ones
the new partitions must end exactly on the same sector or after the old ones
forget about extended partitions... the relevant sector numbers are the primary and logical ones; the rest of the space used by the extended partition will be free
ideally you want them in the same order, and with anything boot related to be created with numbers in order starting on 1 and before 2TiB (avoid some problems maybe caused by hardware, firmware, bootloaders)
you either need to boot in legacy mode and create a >= 1MiB bios_grub partition with the bios_grub flag on (parted /dev/sdX set 1 bios_grub on), or boot in UEFI mode and create an ESP partition (formatted with mkfs.vfat -F 32 ... and esp flag on: parted /dev/sdX set 1 esp on). Or you can create both and boot either at any time. (I would put bios_grub before ESP, and haven't tested the other way around). This is NOT your /boot partition... it's in addition.
due to previous item, prerequisite is that there is enough space left before the partitions you had alrady to add this one. On windows, just shrink the recovery volume, or on linux, shrink and move boot or swap. If that fails, you can clone it to another place, resizing as you clone or when you clone it back.
you will need to reinstall the bootloader with grub-install ... (if the distro doesn't figure out the rest automatically, here it is fully grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=ubuntu --recheck --no-floppy /dev/sdX), or use other EFI things, not grub.
I recommend generating a new initramfs... it'll figure out which modules you need, which may have changed... I don't know.
and then for special setups, just repeat whatever is necessary to make it work, such as encryption... which may not be the same way as your installer did it. This is just about the bootloader, not the tools and rootfs.

Use gparted or another partitioning tool from the live cd to format the drive and create a GPT partition table, then install Ubuntu.  It will keep the existing partition table.


No operating system found I was installing ubuntu (13.04) and it somehow whenver restarts to complete the install starts installing again!!! So, I did not go ahead and wanted to use windows 7 which is already there on my vaio. But now, it says no operating system found!!

Would be glad if someone could help. (Actually it was saying many times during install that no device on port 2 or something like that)...

Thanks in advance

Suggest you follow the instructions from Microsoft to restore your Windows 7 installation. There are numerous tutorials to do that. Here's one example: http://www.sevenforums.com/tutorials/3413-repair-install.html


Xubuntu 14.04 Kernel Panic I am trying to install Xubuntu 14.04 desktop i386 on an older PC (~2002) by using Plop Boot Manager and a bootable USB flash drive. The installation process begins but eventually crashes with this message:
http://i60.tinypic.com/27wrlfp.jpg
PC Specs:

Memory
Hard drive
CD
CPU
Video card
Motherboard
BIOS revision
BIOS built date

1.5 GB
40 GB
rw drive
AMD Athlon XP 2000+ 1.67 GHz
Nvidia GeForce4 Ti 4200 64 MB
asus a7v333-x acpi
1002
10/22/02

Questions:

Is this due to an incompatibility between the kernel version and PC
hardware?
If so, what is the correct way to resolve this error?

Thank you :)

Your best best is to get an older version of Ubuntu, think 12.04 would be best.

Also it could be caused by a corrupted hard drive. Check S.M.A.R.T. readings in BIOS (if it has that functionality).

May I suggest using CD/DVD for installation as well, if possible. If not, try to find a PC where you have a DVD drive, burn an image of Ubuntu, boot from it (live CD) and use the wizard to make a USB image. This will eliminate any errors that may be caused by Plop.

Last but not least, your USB stick can be as old as your computer, and be corrupted. Try with another one.

If none of this works, well, there is always Windows XP.


Whats the simplest way to edit and add files to "/var/www"? Having installed the web server is there a simple way to set a user able to use the graphic interface to copy files and directories to the local web server /var/www

I gave myself administrative privileges in Ubuntu but it still doesn't allow copies.

If you make /var/www writeable by its group and add the user to the group, that user will not have to use sudo. Try this:

sudo adduser <username> www-data
sudo chown -R www-data:www-data /var/www
sudo chmod -R g+rwX /var/www

The user should then be able to edit /var/www/ files without hassle.

The first line adds the user to the www-data group, the second line clears up any files with messed up ownership, and the third makes it so that all users who are members of the www-data group can read and write all files in /var/www.

If you are logged in as <username> you need to log out and log back in for the group membership to take effect.

If you're using the server version, try webmin. It has a great web UI and file manager. Either that or Filezilla


How do I reinstall java after completely uninstalling it? I followed a guide on completely uninstalling java but now I want to reinstall it again is that still possible using only the terminal because my computer won't boot anymore because of it?
I used this guide How to completely uninstall Java?

dpkg: error processing package openjdk-8-jre-headless:amd64

dpkg:dependency problems prevent configuration openjdk-8-jre:amd64 depends on openjdk-8-jre-headless:amd64
package openjdk-8-jre-headless:amd64 is not configured

I tried using the Linux mint USB drive i booted with the very first time and used bootrepair
Here is the pastebin link if it's usefull:
http://paste2.org/AtCm82xj

If all else fails is there a way for me to use that drive but to keep nu files?

Try to login as guest. If that is successful, it would seem to suggest your personal user account is requiring java during boot and you may need to verify the bash startup files e.g. bashrc etc


How should I troubleshoot this weird SSD issue? I'm having a confusing issue with my SSD. I will describe some of the symptoms.

Randomly the GUI will crash. The launcher and panel disappear, programs won't launch and eventually everything blanks out.
I can switch to another TTY, but when I try to log in I get the message

  I/O error, dev sda, sector [some sector number]

I then have to force reboot my machine at which point the BIOS fails to recognize my disk and leaves me at a blank command prompt.
The first time this happened, I thought my drive was dead, but it turns out if I just shut down my machine and start it back up, the drive appears again and I can boot into Ubuntu.

It seems like everything points to a failing drive. BUT besides this issue I can't find any evidence of this.

All the SMART tests are positive.
I've run e2fsck on both partitions and it seemed to be fine.
I rad badblocks to check for bad sectors and nothing was found.
I've checked dmesg after an incident and nothing jumps out.
Most importantly, this issue is reproducible. As long as I force shut down, then bring the machine back up, everything is fine for an hour or so. If I reset the machine, the BIOS can't load the drive. I've done this probably 10 times now and the results are always the same.

I just don't know what else to check now. I'm fine with getting a new drive if I need to, but since I can't actually prove that it's broken, I don't want to replace it unnecessarily.

Basically, can anyone recommend any other tests or debugging steps to prove one way or another the state of my disk?

At Tom Brossman's suggestion, I tried switching the SATA port used by the drive. This had no effect. I also changed SATA cables which didn't work either.

Here's the output of e2fsck.

Here's the output of `badblocks -v'

Drive information

SMART status

I have the same problem with my Dell Latutide E6530 and  ADATA SSD SX900 512GB.
It looks like a problem with disk controller and the cache.

I found some workaround.
Even if cache is on I enable it again by:

sudo hdparm -W1 /dev/sda

Very seldom (do not ask me why) it do not work so in this case I disable cache:

sudo hdparm -W0 /dev/sda

Did you check it out with any Windows? It should answer if it is hardware of software problem.

LEIGH BARTON
Sectionalize, localize, and isolate the problem.
My first step in assessing this problem would be to run the computer from an installation disk using the try ubuntu feature. Try to determine if the computer functions properly using the live operating system. If it does, then it's down to data storage/recovery system in the computer. If not, it's an issue with the computer itself, such as overheating. Assuming the live operating system functions properly, it becomes a hardware/software problem in data management. Your test results indicate that the hardware is functioning within specifications, bearing in mind that Solid state drives are relatively recent and still have some bugs to be worked out. That leaves software and the multitude of problems that can strike. That means data corruption, viruses, or program conflicts. The only feature of the operating system that shuts down the screen is the screen saver, try disabling the screen saver, tell it never to shut down the screen. I don't know what type of decontamination software you run on the computer, but I went for Clam-TK right after installation. Scan for viruses. Finally, there's the possibility of program conflicts, if you didn't install any programs just prior to these symptoms developing it's unlikely, and since I'm relatively new to LINUX myself I can't tell you what software to use to look for conflicts. You'll have to research that on your own. That's as much as I can offer.


No bass from the speakers In Ubuntu 11.10 no bass sound at all when try to play mp3 or 2channels audio. I have 5.1/6 channels speakers.

When I test speakers from the sound preference it works perfectly fine and then I try to play any MP3 there is no bass only the speakers work, I play 5.1 movies it plays fine bass sounds good.

Also tried to to some changes as instructed with deamon.conf file but no go...

When I turn my speakers on play speakers only mode it plays the bass but sound quality is not good compared to normal playing. I have a Creative 5.1 vx ca0160 sound card.

In Windows also had the same problem unless I do bass redirection crossover frequency so is there any kinda software package or any kinda changes i can make in system file so that my speaker bass works fine or any thing who can let me change the bass redirection crossover  frequency?

Configure your player for channels, If you are using Totem, got0 edit-preferences-Audio and change the Audio Output type to 5.1,

If neither of the other responses work I would recommend going to the motherboard manufacturer's website, look up your motherboard and search for Linux sound drivers.

-Best of Luck


How can I cancel my Ubuntu installation in progress? I have a dual boot setup with Windows 7 and Ubuntu, but I was having problems with Ubuntu 12.10.

I tried to reinstall Ubuntu, but the installation has taken  20 hours already and is not advancing. It's stuck on Unpacking flashplugin-installer. How can I cancel the installation and try again?

Yes you can cancel a currant install by holding down the power button for 10 seconds. Then just start over the install from scratch. good luck, it happens to all of us at some point.


AVerTV Hybrid Volar Q I have recently received a AVerTV Hybrid Volar Q USB TV tuner and it works great in Windows. However, I am unable to get Ubuntu to detect it. I would appreciate hearing from anyone who has managed to use this device with Linux.

The results of lsusb are below and as you can see the TV-tuner is listed. Unfortunately, that is as far as it goes. The adapter is not recognised by any apps. It's just sitting there so tantalisingly close yet completely out of reach.

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Bus 002 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

Bus 001 Device 002: ID 413c:a005 Dell Computer Corp. Internal 2.0 Hub

Bus 001 Device 003: ID 07ca:0837 AVerMedia Technologies, Inc. H837 Hybrid ATSC/QAM

Bus 001 Device 004: ID 0b97:7761 O2 Micro, Inc. Oz776 1.1 Hub

Bus 001 Device 005: ID 413c:8103 Dell Computer Corp. Wireless 350 Bluetooth

Bus 001 Device 006: ID 0b97:7762 O2 Micro, Inc. Oz776 SmartCard Reader


How to change Details in System Settings I want to make my own linux distribution based on Ubuntu 14.04 and I want to know how can I change the logo picture with Ubuntu in System Settings >> Details >> Overview.

Just edit this picture :)

/usr/share/unity-control-center/ui/UbuntuLogo.png


Is it safe to resize root partition? My HDD is partitioned into two equal sized partitions. First is being used for Windows and Second for Ubuntu. Everything is working fine. But now I want to remove Windows and use the disk completely for Ubuntu. I can easily boot from live cd and use GParted to delete Windows partition and then expand Ubuntu partition to use the whole hard disk.

I want to know if its safe
Will resizing Ubuntu partition change any thing else like the partition UUID or any thing else?
Do I need to reinstall grub after resizing the root partition?

It would be great if some one who has already done this can give their advice here.

I want to know if its safe

Generally, operations can fail. If operations on partitions fail, it can cause data loss, so be prepared and do backups first.

  Will resizing Ubuntu partition change [...] the partition UUID

No.

  Do I need to reinstall grub after resizing the root partition?

No.

It doesn't even matter if you've installed GRUB2 into the MBR (e.g., /dev/sda, default when installing Ubuntu), or into the root partition (e.g., /dev/sda1).

yes you can and the problem is with ubuntu being in a logical partition. just use testdisk write the partition table backup your data and install ubuntu with option to use the entire disk. that is it. i had the samr prob and solved it.


Dual booting on a laptop with SSD and HDD I saw a couple similar questions but they are pretty old (from win7 time) and I wanted to get an up-to-date answer.

I'm going to buy a new laptop with a 128GB SSD and 1TB HDD. I would like to dual boot both Windows10 and Ubuntu (or possibly Mint). Would the SSD be large enough to handle all windows and linux system files? My goal is to install both OSs on the SSD so it will boot fast and then use the HDD as overflow storage once the SSD starts filling up. How should I go about partitioning everything? Thanks!

Although this question is asking for answers which are primarily opinion based, the official documentation does state that you only need a certain amount of partitioned space for your installed operating system.

With that said, you should certainly have enough space.

I recommend you use 2/3 of the total disk space for the OS you plan to use the most, including any swap partition if the OS uses swap.


Why is 777 assigned to chmod to permit everything on a file? I was asked in an interview why it is that 777 is assigned to take all permissions for a file. Why not 555? He said that there is reason for everything. So, what is the reason for 777? Why not any other number? Is there any significance in this number?

I'll try to address the underlying reason why it is 777, rather than aaa, or 999.

Remember that permissions come in the following format:

 u   g   o
rwx rwx rwx

where u=user, g=group, o=other.

Now, imagine you are representing each of these groups as binary. 1 is true, 0 is false.

If you want to give full access to everyone, you would assign the following permissions in binary:

 u   g   o
rwx rwx rwx
111 111 111

Now, if you know binary, you will realise that when you convert 111 from binary to decimal, you get 7.

Thus, you can represent full access as 777.

Note: We are really converting from binary to octal. See the edit below.

This works for all the other access modes as well.

For instance, we can easily work out what 555 means by converting each 5 to binary, and writing it in the above format. 5 in binary is 101, so we have the following permissions:

 u   g   o
r-x r-x r-x
101 101 101
 5   5   5

Similarly, if we want to give all permissions to the user, but only allow other people to read, we can find a number representation.

 u   g   o
rwx r-- r--
111 100 100
 7   4   4

Now, we know that 111 in binary is 7 in decimal, and 100 in binary is 4 in decimal. Thus, the permissions will be 744.

Edit:

Technically, as highlighted by @LưuVĩnhPhúc and @Braiam, we are converting from binary to octal, as described below. However, the decimal and octal representations of numbers < 8 are the same, so for binary numbers with 3 digits or less, both decimal and octal representations are the same.

When represented as octal numbers, rather than splitting into groups of three, and doing binary to decimal conversion on each group, you can actually take all three groups together as a single binary number, and convert to octal.

For example, here are some binary to octal conversions:

0b111111111 == 0o777
0b101101101 == 0o555
0b111100100 == 0o744

Note that I am prepending "0b" and "0o" to distinguish between binary and octal numbers.

If you want to play around with this, open a terminal, run python and then play around with the following commands:

oct(0b111111111)
bin(0o555)

Remember to prepend "0b" or "0o" to the numbers to let the computer know what base you are interested in. (If you don't, it will assume base 10.)

Nowadays, we all know that a byte is 8 bits: this has been universally agreed upon for decades. But that wasn't always the case, and Unix (which inspired Linux in many ways) was written during a time when this was still being debated. In particular, it needed to be portable to systems that used 6-bit bytes or 8-bit bytes. Some of the people who wrote it were on one side of the debate, and others were on the other side.

On a related note, Base-2 (binary) is not a very convenient notation for writing out values. Nowadays, most programmers write out a more compact notation that uses Base-16 (hexadecimal) instead. 16 is just big enough of a base that you could exactly pack four bits into one hex-digit: for example, "0000" in binary is 0x0 in hexadecimal (that "0x" is a common way to note that you're about to write a hexadecimal number), while "1111" is 0xF (or 15 in decimal). You can actually write any possible combination of four bits using a single hex digit, just by counting in binary, and because of the way positional arithmetic works, you can stack it up: two hex digits can encode any possible combination of eight bits, just by counting, and so on. So the 8-bit folks loved this.

The 6-bit folks had their own way of doing this, but instead of using Base-16, they used Base-8 (octal). It has similar advantages to hexadecimal: you can store any position of three bits in an octal-digit, and you can stack digits up in a similar way. So just like the 8-bit folks used two hex-digits for a byte, the 6-bit folks used two octal-digits for a byte. You don't see octal very much anymore, but it was typically noted with a leading zero: for example, "111" is 07 in octal.

Now, what does all of this have to do with Unix permissions? As far as Unix was concerned, there are three things you could do with a file: you could read it, you could write to it, or you could execute it as a program. If you're going to restrict that with permissions, then you need a bit for each of them: turn it on for things that someone is allowed to do, and leave it off for things that someone is not allowed to do. Since there are three things being tracked, you need three bits, and since Unix tracks it along three lines (owner, group, and everyone) you need nine bits total.

At some point along the line, someone -probably in the 6-bit camp- said "Hey, we can use octal-digits for this". And this turned out to be a very convenient notation: three octal-digits is just enough to encode every possible combination of the bit fields. Once they decided to do this, 777's fate (and 000's) were sealed, because those numbers would be the same no matter how they arranged the bits, but order mattered for all of the other numbers, so they set about doing this.

They arranged the permissions into three-bit fields: read at the start, write in the middle, and execute at the end. Then they arranged the fields themselves: owner at the start, group in the middle, and others at the end. Once they'd done this, all they had to do to assign the rest of the numbers was count.

Because they're 3-bit fields, you can say that each octal-digit controls one of the fields: the first digit controls owner permissions, the second digit controls group permissions, and the third digit controls other permissions. Thus, 777 (111 111 111) is all permissions for everyone, while 700 (111 000 000) is all permissions only for the owner. Other combinations are also common: 666 (110 110 110) is read/write for everyone but not execute), while 555 (101 101 101) is read/execute for everyone but not write, and 400 (100 000 000) is read-only for the owner and no access for anyone else.

And that's why 777 means all permissions. These days, it's probably the most popular reason for people to use octal at all, though Unix and its descendants still have a few other vestiges of it. For example, od, or Octal Dump, is a way to get binary dumps of a file in octal form (it has a hexadecimal cousin, called xxd, but that's not as well-known and isn't available everywhere). It's also why you need to be careful with leading zeroes in some programming languages, because they might think that you intend to write numbers in octal when that's not really your intent.


Rip a DVD title with IFO and BUP files from the command line Like the title says, I would like to rip a DVD title with IFO and BUP files from the command line. I have tried several programs with varying results.

Using dvdbackup:

dvdbackup -i imagefile.img -o /home/username/tmp -t 1

...but this way there are no IFO or BUP files. So I continued to re-author result using dvdauthor:

dvdauthor -t -o /home/username/tmp/dvd *.VOB

...but the re-authored files do not include some important info, like the subtitle language names.

Using vobcopy:

vobcopy -n 1 -i imagefile.img -o /home/username/tmp

...No IFO or BUP files.

Using mplayer:

mplayer dvd://1 -dvd-device imagefile.img -title 1 -dumpstream -dumpfile title1.vob

...No IFO or BUP files.

Using cpvts:

cpvts -d /media/dvd -t 1 /home/username/tmp

cpvts has some problems. It rips the whole titleset, not the individual title. This takes a lot of space when ripping several titles separately. Also it needs some dependecies, which are deprecated.

When doing dvdbackup -M (-M for mirroring) I do get all the ifo and bup files. One thing to keep in mind is not to mount the device.


What is a program similar to WinSCP? In Windows I use WinSCP to transfer files server-side. It has a very attractive feature that I like best: keeping remote folders up to date.

This means, whenever my local file is changed, WinScp will replace the same file on the server with this new file.

Could you suggest me software that support this feature?

Nautilus the default file browser has the feature of mounting remote files.

Go to File Menu > Connect to Server..

Other than that filezilla and gftp support sftp.

I'd suggest SecPanel https://apps.ubuntu.com/cat/applications/saucy/secpanel/ especially if you're using 13.10.


Why does ping fail with "icmp open socket: Permission denied" on Bash on Win 10? On my win10 machine in cmd prompt I've activated bash with

lxrun /install /y

then

neilh>bash

root@NHPINSP:/mnt/c/Users/neilh# ping google.com
$ su ping google.com
"ping: icmp open socket: Permission denied"

It also fails as sudo, and su. This is a synthesis of a number of other actions. I initially installed with a username and was trying to do a sudo apt-get update but it failed. So I lxrun /uninstall /full, and then reinstalled the simplest setup to find out why the networking doesn't seem to be working.

My machine is "Test Mode" Windows 10  Home, Build 14393.187 (version 1607)

This is a known issue:

https://github.com/Microsoft/BashOnWindows/issues/18.

ping doesn't currently work on WSL.

sudo and su not working are probably a result of the host file not being configured correctly. see this question: https://superuser.com/questions/1108197/sudo-on-windows-10-linux-subsystem-cannot-resolve-local-machine-name

Luckily I found the answer here but it's for ubuntu:

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

sudo chmod u+s `which ping`