Screencast with both mic and system sounds at the same time I'd like to make a screencast that records both mic (audio input) and system sounds (audio output) at the same time. For example, so that I can capture a screencast while talking to someone on Skype and capture both sides of the conversation. How can I do this? (I'm using Natty if it matters.)

So far I have tried Kazam, RecordMyDesktop and Tibesti. (Tibesti explicitly has this feature but it doesn't seem to work. Kazam has existing enhancement requests for this feature.)

Please provide complete instructions/options, like those given for running RecordMyDesktop from the command line in this generic screencasting answer.

Look for a way to combine sound channels instead of looking for multirecording screencast app. How to mix voice and audio on Ubuntu (archive.org copy) describes how to do it with PulseAudio. This tutorial seems to be based on Weekend Project: Record From Skype Calls and Other Apps on Linux (linux.com). IIRC there are also similar in spirit tricks for JACK)

Hope this is what you are looking for: http://www.youtube.com/watch?v=oWyfG4PVpms.


Custom daemon script: works, but does not run at boot / startup this is Ubuntu 10.10 Maverick.

I have the following shell script in init.d that I want to run as a "daemon" (background service with start/stop/restart really) at system startup. There is a symlink in rc3.d. I tried 4 and 5 too. (Ideally this would initialize before graphical login happens and before a user logs in.)

IMPORTANT: the script works 100% as expected and required when testing this with service MetaLeapDaemon start and service MetaLeapDaemon stop. (This shell script calls a Python program which makes sure the appropriate .pid files are both created at startup and deleted at exit.)

So generally it works fine but now my only issue is why it will not be run at any of the run-levels I tried. I know for sure it isn't run because the log file it normally creates does not get created.

As you can see (by the lack of any uid:gid args in the start-stop-daemon commands) this would currently run only under root, is this forbidden in a default setup?

Here's the script, pretty much your run-off-the-mill daemon script really:

#! /bin/sh

DAEMON=/opt/metaleap/_core/daemon/MetaLeapDaemon.py
NAME=MetaLeapDaemon
DESC="MetaLeapDaemon"

test -f $DAEMON || exit 0

set -e

case "$1" in
    start)
        start-stop-daemon --start --pidfile /var/run/$NAME.pid --exec $DAEMON
        ;;
    stop)
        start-stop-daemon --stop --pidfile /var/run/$NAME.pid
        ;;
    restart)
        start-stop-daemon --stop --pidfile /var/run/$NAME.pid
        sleep 1
        start-stop-daemon --start --pidfile /var/run/$NAME.pid --exec $DAEMON
        ;;
    *)
        N=/etc/init.d/$NAME
        echo "Usage: $N {start|stop|restart}" >&2
        exit 1
        ;;
esac

exit 0

I'm answering this for completeness, even though you already went with an Upstart job (and that is the way to go, I'm not suggesting here you go back)....

I think the key thing you missed first time around was the runlevel.  I'm going to guess you are used to RPM distro's where it's typically runlevel 3 for multiuser and runlevel 5 for GUI?

In Debian and Ubuntu, there's really only single user (1) and multiuser (with GUI if installed).  And multi user is runlevel 2.  So your symlinks failed because you never got to RL 3.

Using the update-rc.d command makes managing the symlinks easier.

In any case, I'm writing this up for anyone else you might actually need it.  Though I would suggest they convert the script to an Upstart too!

Use the following command to start your script at startup.

Add it to the startup applications.

sudo -u USERNAME COMMAND

By the way, someone told me to use NOPASSWORD, else it won't work:

  You'd better run sudo visudo to edit the /etc/sudoers file and add a NOPASSWD for the command instead of writing the password in the script. – Lekensteyn

I hope this helped you,

Daniel


How do I change the color for directories with ls in the console? On my console the color for directories is such a blue, that it is hard to read on a dark background.

How can I change the color definitions for ls?

To change your directory colors, open up your ~/.bashrc file with your editor

nano ~/.bashrc

and make the following entry at the end of the file:

LS_COLORS=$LS_COLORS:'di=0;35:' ; export LS_COLORS

Some nice color choices (in this case 0;35 it is purple) are:

Blue = 34
Green = 32
Light Green = 1;32
Cyan = 36
Red = 31
Purple = 35
Brown = 33
Yellow = 1;33
Bold White = 1;37
Light Grey = 0;37
Black = 30
Dark Grey= 1;30

The first number is the style (1=bold), followed by a semicolon, and then the actual number of the color, possible styles (effects) are:

0   = default colour
1   = bold
4   = underlined
5   = flashing text (disabled on some terminals)
7   = reverse field (exchange foreground and background color)
8   = concealed (invisible)

The possible backgrounds:

40  = black background
41  = red background
42  = green background
43  = orange background
44  = blue background
45  = purple background
46  = cyan background
47  = grey background
100 = dark grey background
101 = light red background
102 = light green background
103 = yellow background
104 = light blue background
105 = light purple background
106 = turquoise background
107 = white background

All possible colors:

30  = black
31  = red
32  = green
33  = orange
34  = blue
35  = purple
36  = cyan
37  = grey
90  = dark grey
91  = light red
92  = light green
93  = yellow
94  = light blue
95  = light purple
96  = turquoise
97  = white

These can even be combined, so that a parameter like:

di=1;4;31;42

in your LS_COLORS variable would make directories appear in bold underlined red text with a green background!

To test all these colors and styles in your terminal, you can use one of:

for i in 00{2..8} {0{3,4,9},10}{0..7}
do echo -e "$i \e[0;${i}mSubdermatoglyphic text\e[00m  \e[1;${i}mSubdermatoglyphic text\e[00m"
done

for i in 00{2..8} {0{3,4,9},10}{0..7}
do for j in 0 1
   do echo -e "$j;$i \e[$j;${i}mSubdermatoglyphic text\e[00m"
   done
done

You can also change other kinds of files when using the ls command by defining each kind with:

bd = (BLOCK, BLK)   Block device (buffered) special file
cd = (CHAR, CHR)    Character device (unbuffered) special file
di = (DIR)  Directory
do = (DOOR) [Door][1]
ex = (EXEC) Executable file (ie. has 'x' set in permissions)
fi = (FILE) Normal file
ln = (SYMLINK, LINK, LNK)   Symbolic link. If you set this to ‘target’ instead of a numerical value, the color is as for the file pointed to.
mi = (MISSING)  Non-existent file pointed to by a symbolic link (visible when you type ls -l)
no = (NORMAL, NORM) Normal (non-filename) text. Global default, although everything should be something
or = (ORPHAN)   Symbolic link pointing to an orphaned non-existent file
ow = (OTHER_WRITABLE)   Directory that is other-writable (o+w) and not sticky
pi = (FIFO, PIPE)   Named pipe (fifo file)
sg = (SETGID)   File that is setgid (g+s)
so = (SOCK) Socket file
st = (STICKY)   Directory with the sticky bit set (+t) and not other-writable
su = (SETUID)   File that is setuid (u+s)
tw = (STICKY_OTHER_WRITABLE)    Directory that is sticky and other-writable (+t,o+w)
*.extension =   Every file using this extension e.g. *.rpm = files with the ending .rpm

A more complete list is available at Bigsoft - Configuring LS_COLORS.

On some distributions, you might also want to change the background color for ow "(OTHER_WRITABLE) whose default is non-readable" for example to non-bold blue text on green background.

You could use for instance LS_COLORS="$LS_COLORS:di=1;33" at the end of your .bashrc file, to get a nice readable bold orange text on black background.

After you alter your .bashrc file, to put the changes in effect you will have to restart your shell or run source ~/.bashrc.

Note: You can combine more commands with a colon, for example

LS_COLORS=$LS_COLORS:'di=1;33:ln=36' ; export LS_COLORS; ls

Source:

COLORS Lscolors - Linux StepByStep
Geek Gumbo - Changing the Directory Color in Bash

The is my approach for ls command with commonly used options:

add the following lines into a file called ~/.alias

alias ll='ls -lhF --color=auto'
alias llt='ls -lht --color=auto'
alias lla='ls -alF --color=auto'
alias la='ls -A --color=auto'
alias l='ls -CF --color=auto'
alias ls="ls --color=auto"

add the following lines into ~/.bashrc

if [ -f ~/.alias ]; then
    . ~/.alias
fi


Apt-get update through an evil proxy I am running Ubuntu 16.10 KDE on a laptop on a wifi network that somehow forces a proxy without the need for it to be configured. Whenever I try apt-get update I get the following error:

Get:1 http://archive.ubuntu.com/ubuntu xenial InRelease [2827 B]
Err:1 http://archive.ubuntu.com/ubuntu xenial InRelease
  Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
Get:2 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [2835 B]
Err:2 http://archive.ubuntu.com/ubuntu xenial-updates InRelease
  Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
Get:3 http://archive.ubuntu.com/ubuntu xenial-security InRelease [2836 B]
Err:3 http://archive.ubuntu.com/ubuntu xenial-security InRelease
  Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
Fetched 8498 B in 0s (11.7 kB/s)
Reading package lists... Done
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial/InRelease  Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-updates/InRelease  Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
E: Failed to fetch http://archive.ubuntu.com/ubuntu/dists/xenial-security/InRelease  Clearsigned file isn't valid, got 'NOSPLIT' (does the network require authentication?)
E: Some index files failed to download. They have been ignored, or old ones used instead.

Installing a package returns errors like this:

Err:12 http://archive.ubuntu.com/ubuntu xenial/universe amd64 cabextract amd64 1.6-1
  Hash Sum mismatch

I have already tried setting the http-proxy variable using my username and password to no avail. The proxy does the exact same thing.

Is there any way to prevent it from doing whatever it's doing?

Does anybody know what NOSPLIT is? (If you do, could you comment?)

This is not a duplicate of questions like these:

'apt-get update' fails when using proxy

Got NODATA issue: 'NODATA' (does the network require authentication?)

because their answers do not work.

Frankly, my organization doesn't care whether their proxy is interfering with my installing software, because I'm the only one trying to do it, so asking them is out.
Also, I don't have the same problem as the NODATA issue, because wget -O - http://extras.ubuntu.com/ubuntu/dists/trusty/InRelease returns

--2016-11-11 12:20:26--  http://extras.ubuntu.com/ubuntu/dists/trusty/InRelease
 Resolving extras.ubuntu.com (extras.ubuntu.com)... 91.189.92.152, 2001:67c:1360:8c01::23
Connecting to extras.ubuntu.com (extras.ubuntu.com)|91.189.92.152|:80... connected.
HTTP request sent, awaiting response... 404 Not Found
2016-11-11 12:20:27 ERROR 404: Not Found.

Changing my apt sources to https instead of http solved the problem.

My best guess is that the proxy is configured to act differently over https than over http and it did not attempt to inject a redirect into the https response.

Note that to use https over apt you must have the apt-transport-https package installed.

I managed to get my ubuntu VM working by following this

https://help.ubuntu.com/community/AptGet/Howto#Setting_up_apt-get_to_use_a_http-proxy

export http_proxy=http://proxy.server:8080
sudo -E apt-get update
sudo -E apt-get install etc...

The key point was that I was running apt-get as sudo but setting my http_proxy environment variables as my ubuntu user


Workaround for playing wav files In Ubuntu 13.04 and 13.10 by default when you click on a .wav file, Ubuntu opens the totem video app and plays the .wav file completely garbled. This is a known bug that has been outstanding for quite a while.

What is a good work around?

I'm thinking of a lightweight player to play the .wav files without fuss and which can be set as the default for .wav files. If there is a simple way to make totem work that would probably be even better.

I get voicemails as .wav files and am looking for an easy solution for playing them.

Simply installing any other Audio player should work fine for you. I'd recommend Audacious since it is extremely light on resources and can play nearly every audio codec in existence.

You can install it by clicking the button below or running this command:

  sudo apt-get install audacious

Once installed you can go into your computer details via the dash and click on default applications.

As mentioned in Ubuntu's RestrictedFormats, install restricted extras using below command to unlock codecs.
sudo apt-get install ubuntu-restricted-extras

Else, you may use an alternate player (a well known player which can support almost a high number of codecs) such as VideoLAN (VLC).

You can download it via Ubuntu Software Center
or you be use below command to install via terminal

sudo apt-get update
sudo apt-get install vlc browser-plugin-vlc

EDIT: Ubuntu's restricted extras will not install all needed codecs though there are few that will need a manual install/set-up such as PlayingDVD, Blu-Ray/HD-DVD.. etc. In that case, I'd recommend referring the restricted format as I've linked at the beginning. And to those who would like VLC, refer to the above mentioned points for installation.
Source: VideoLAN


How can I automatically set my status to Busy when Empathy starts? So I can make Empathy log me in on boot, but how do I make my initial status Busy?

After some searching, I found an app that communicates with Empathy via dbus. I pulled some code from that and created a script that will set your status.

Setting it up is pretty easy:

Download the script here (github page).

It requires some python libraries that are in the repos (and might be installed by default):

sudo apt-get install python-dbus python-notify

Then to set it to start on login, run Startup Applications, click Add, and fill in the fields like this:

Name:  Custom -- Start Empathy Busy
Command:  /usr/bin/python /path/to/empathy_set_status.py dnd
Comment:  Start empathy and set status to busy (do no disturb).

The command field includes what status to set. If you don't want busy (dnd), then you can use one of these values: available, dnd, away, xa, hidden, offline.

Now when you log in, the script it should run empathy, wait a bit, and then set your status. You should see a notification when it tries to set your status.

I don't check that the status is set correctly, so I just have a wait time to hope that empathy will be ready to let us change the status. Adjust your time if it's not working. Increase the value of EMPATHY_STARTUP_SECONDS until it works when you login. If you need to enter a password to unlock your keychain for your IM login, the delay will have to be long enough for Empathy to start up, for you to enter your password, and for Empathy to log into your accounts.

Try pidgin.

Please see the below link

http://ubuntuforums.org/showthread.php?p=9241006


How to save after editting 'vi common.mak' (aircrack-ng) on Ubuntu 12.04 I followed the steps from here >> http://securit.se/en/2012/03/kompilera-reaver-ubuntu-12-04/

everything was going good till I reached this point.

after I found the following lines in the file

CFLAGS   ?= -g -W -Wall -Werror -O3

and edited it to make it like this >>

CFLAGS  ?= -g -W -Wall -O3

But then I am supposed to save the file, how?. when I close the terminal I was expecting them to prompt 'save file before exit' but it does not, theres just 2 options 'cancel' and 'close terminal'

HOW DO I SAVE?

In short, press Esc to get out of insert mode, and then do :wq to write the file and quit.

But in general you don't have to use vi - when you see it in instructions on the web, use nano (edit in terminal) or gedit (GUI editor) instead. When you typed:

vi common.mak

You were launching the vi editor to edit the file common.mak. Instead you could do:

nano common.mak

or

gedit common.mak

to edit the file in an editor that doesn't require learning to do simple things like saving a file.

Or if you want to learn vi then type vimtutor at the command line - that will get you to the point where you can be reasonably efficient with vi. If you find you like vi and want to learn lots more then read this post.

use sudo gedit common.mak and save it. I have done it in my video
http://www.youtube.com/watch?v=apoaHf8tPVk


Ubuntu 12.04 'Preparing for first use' stuck - Desktop installer Right after the Ubuntu Installer finishes installing Ubuntu, it prompts me to reboot the system.

It boots up and loads the Ubuntu loading screen with the dots, then it says it's preparing for first use.

But, then it froze and the dots stopped moving. It's been like this for a good 10-15 minutes.

Is it still installing or did something went wrong?

System Specifications:

Model : Dell Inspiron 530 Mini Tower.
Intel Celeron 450 @ 2.4 GHz processor
RAM : 2GB DDR2 SDRAM
Intel Integrated G33 Family Chipset graphics

Note: I've also installed previous versions of Ubuntu which worked flawlessly on PCs with worse specs than this.

Other info - I'm attempting to install this alongside (triple-boot) Windows 7 and Windows 8.

I have a triple boot myself (vista, ubuntu 11.04 and ubuntu 12.04).  The problem i encountered was the same as yours.  On the grub menu choose ubuntu 12.04, press e, look for the line "quiet splash", and change it to "quiet splash nomodeset", and continue with booting.  If this solves the problem you have tot do this modification permanently as root  with changing the grub file in /etc/default/grub  with the same modification. Do not forget a sudo update-grub afterwards.


Cannot copy text from Acrobat reader on Ubuntu I'm using Adobe Reader version 9.5.5 04/26/2013 on Ubuntu 14.04.4 LTS. I can select some text in Acrobat reader, I can use the menu Edit->Copy but when I paste in Gedit, nothing happens and nothing is copied. Is this a bug or is there a special setting somewhere?


Unable to 'apt-get dist-upgrade' due to appstreamcli database error I have created a USB stick with a persistent Ubuntu 16.04 (release version). I tried a couple of ways, using Startup Disk Creator and MultiSystem, but I get the same end result.

When I boot into the USB and do 'apt-get update', all is well.  When I try 'apt-get dist-upgrade' I get:

  ** (appstreamcli:2761): CRITICAL **: Error while moving old database out of the way. AppStream cache update failed.

The only reference to this error message I can find is https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/1561472 but would appear to be fixed, at least fixed by the time the release version of Ubuntu 16.04.

Aside: I want to test Unity8, which includes installing software.  I don't have a spare computer, so I thought a persistent USB would do the trick.

Any takers?

This also happened to me using 16.04.1 live Ubuntu persistent USB stick.

uncledave's solution didn't work at first, but as suggested, changing the rights was the final solution.

Then I've found answer #11 from daniel-gimpelevich for bug 1601971
The following commands helped me repair apt-get update

sudo chmod -R a+rX,u+w /var/cache/app-info/xapian/default

How did I guess that 755 is the right mask? The difference between

ls -ld /var/cache/app-info/xapian
drwxr-xr-x 1 root root 4096 Nov 19 20:35 /var/cache/app-info/xapian/

and

ls -ld /var/cache/app-info/xapian/default
drw-r--r-- 2 root root 4096 Jul 19 20:54 /var/cache/app-info/xapian/default

After this apt-get update ran fine.

sudo apt-get update
Hit:1 http://archive.ubuntu.com/ubuntu xenial InRelease
Get:2 http://security.ubuntu.com/ubuntu xenial-security InRelease [94.5 kB]
Get:3 http://archive.ubuntu.com/ubuntu xenial-updates InRelease [95.7 kB]
Fetched 190 kB in 0s (312 kB/s)
Reading package lists... Done

Note1 Upgrading a live persistent USB stick this way is not suggested it will cause issues if too many packages are installed/upgraded.

Note2 It's a better idea to install Ubuntu directly to the USB stick if you want to use it as a bootable "Swiss Army Knife".

I don't know how to fix this problem properly, but calling apt-get dist-upgrade twice is working for me, I'm able to reproduce it on an installed Ubuntu though  (at the first call there will be the error, but the second call works).


Do I need a firewall for my desktop? I don't have a  router, but I mostly use my desktop for online shopping and torrenting. So, do I have to enable the firewall? I hope not, because I'm really dumb and I don't think I will be able to configure the firewall.

So, do I have to enable the firewall? I hope not, because I'm really dumb and I don't think I will be able to configure the firewall.

Well, if you say so, I would recommend you do not touch any firewall setting. But, hear me well you will be exposed to all kind of threats in the internet. If some time the system start acting weird, or your PC gets filled with spam/advertisement, software you never installed is there, you notice that your bank account is empty, don't get scared. And no, this is not an FUD. Without any kind of layer of protection, his system (and himself) will be vulnerable to all kind of attacks from the internet.

If you don't know how to setup a Firewall and have no router I recommend you to read:

How can a non-geek set up a proper firewall?
A commentary from Eliah Kagan about the dangers of not having NAT/Router and a PC at home
Why is the firewall disabled by default?

The firewall in Ubuntu is enabled by default working behind the scenes. So no you don't have to enable it.


how to umount /home in ssh? I would like ssh, sudo su and umount /home and run diagnostic on it.  Is there a runlevel I can used to close X and other process using /home while keeping network access?  Or another way?

thanks

First, log out all user manually, then ssh with root.

Use "lsof | grep home" to find remaining process that use /home and kill them all.

You can umount.

/home is only typically in use when users are logged in.  The root user has a /root home specifically so the root user is not dependent upon additional mount points.

Enable root SSH login

For Ubuntu this means you need to give root a password in order to login via ssh:

https://help.ubuntu.com/community/RootSudo#Enabling the root account

Consider that the root account may be disabled from SSH access by default, verify the setting in /etc/ssh/sshd_config:

PermitRootLogin yes

Logoff users and prevent new logins

To kick users off in a multi-user environment one would normally change to the single-user run level 1.  However this is pretty much a console or serial port only task as sshd by default is configured only for run levels 2, 3, 4, and 5, and that you will likely lose your ssh connection.

http://www.debianadmin.com/debian-and-ubuntu-linux-run-levels.html

The not so great alternative is judicious use of killall --user but has to be applied to each and every user.  Only the login (pseudo) terminal process needs to be killed and a more refined approach can be taken, for example:

skill -KILL -v /dev/pts/*

The next problem is prevent users immediate sign back in.  You can create the file /etc/nologin to prevent user logins, you need to ensure pam_nologin.so is enabled on Linux for all PAM methods such as SSH:

http://www.novell.com/support/dynamickc.do?cmd=show&forward=nonthreadedKC&docType=kc&externalId=7007116&sliceId=1

This is also provided by the shutdown -k command:

  -k     Only send out the warning messages and disable logins, do not
  actually bring the system down.

Finally

You can unmount /home.


Is it possible for 2 users to work at the same time, one is connected remotely? And how to set it up? I am running Xubuntu on my main PC at home.

Is it possible for 2 users to work simultaneously on one computer,
while one is physically in front of the computer, and another one is connected remotely from another Ubuntu PC?

EDIT: Both users need a GUI environment.

If yes, how do I set it up?

EDIT 3: I have a powerful desktop PC (recently converted to Linux :) ) and 2 laptops. The desktop PC has a VM with all the Graphic Design software on it.  Me and my friend both work on a web project, and the laptops are not suitable for it. The laptop is good for development, but every now and then I need to access the Graphical Design software, so I need the Desktop. My friend works on Linux Graphics tools and also needs the Desktop.
So we decided to share the Desktop, while he will be working on it directly, I would like to connect to it from my Laptop to access the VM. Desktop and laptop are in one LAN.

EDIT2: Thanks, for the comments and answers, I got on track with this. A quick search revealed 2 options:

SSH-X or "X11 Forwarding via SSH" (as you already pointed out)
FreeNX

Which direction would you recommend? Or a better alternative if you know one.

Sorry for bad explanation, I don't have good writing skills.

There are many ways you could accomplish this, the first couple that are most often used would be ssh (Secure Shell - so, primarily command-line interface to start), and other graphical interfacing methods like rdesktop.

You can also use a combination of ssh and rdesktop or other methods, depending on what you're trying to accomplish.  As other users have mentioned, however, it would be worth describing (in some detail) what you're trying to achieve.  ;)

Since you want a GUI-interface for both of the simultaneous users, I'd suggest using xrdp and the aforementioned rdesktop

sudo apt-get install xrdp

Then run rdesktop from whatever machine you're trying to connect to the server from.  A good test (done entirely on the server) is doing the following:

rdesktop localhost

.. and logging in as the 'second' user.  If it works, you'll simply need to try from the other machine the same way, but there's no need to install xrdp on that system (since that's the server).

Alternatively, if you just want to connect via a shell interface:

sudo apt-get install openssh-server

... and, with the very basic default configurations, you're already setup to go.  Assuming your network has no port blocking or firewalls on the server-side, you should then be able to (from the other PC):

ssh <server IP address>

Or, to test on the server just to ensure it's ready (you would actually do this on the server's terminal window itself):

ssh localhost

Definitely look at ssh --help for detailed instructions on how to specify ports, users, etc. as you please.

I'd use VNC because I have had experience of running several user sessions on the server ("powerful desktop machine") each tempted to a different desktop.

VNC was never designed to be just for sharing a desktop with other people.

The heavy computing is all done on the server, and all the laptops have to do is show the picture that results from it - and pass keystrokes and mouse movement back.

I'm interested that desktop also does it for Linux.  Good.


How to know the usage of the command before I download through command I would like to know what's the purpose or usage before I use "apt-get install" to install it.

There is an Ubuntu website that has exactly that purpose. It's called Ubuntu Apps Directory. Just visit the Ubuntu Apps Directory website, and type the name of the app you want more information about in the search box next to where it says Search for an app. Then you'll get a fairly complete description of the app and also usually one or more screenshots. The screenshots start off small-sized, you can click on a screenshot to enlarge it to fullscreen.

You could download the source and read the README file inside.

apt-get source package-name


Create USB installer to install Ubuntu from the command line? I'm trying to create a bootable USB image to install Ubuntu on a new computer.

I have done this before following the "create USB drive" instructions for Ubuntu desktop, but I don't have an Ubuntu desktop available.

How can I do the same using only the command line?

Things I've tried:

Create bootable USB on Mac OS X following the ubuntu.com "create USB drive" instructions for Mac: Doesn't boot.
usb-creator: According to apt-cache search usb-creator and Wikipedia usb-creator only exists as a graphical tool.
"Create manually" instructions at help.ubuntu.com: None of the files and directories described (e.g. casper, filesystem.manifest, menu.lst) exist in the ISO image, and I don't know what has replaced them.
unetbootin scripting: Requires X server (graphics support) to run, even when fully scripted. (The command sudo unetbootin lang=en method=diskimage isofile=~/ubuntu-10.10-server-amd64.iso installtype=USB targetdrive=/dev/sdg1 autoinstall=yes gives an error message unetbootin: cannot connect to X server.)

Update

Also tried GRUB fiddling: Merging information from

pendrivelinux.com
a related question on the Linux Stackexchange
and a grub configuration example

I was able to get halfway there - it booted from USB, displayed the grub menu and started the installation, but the installation did not complete.

For reference, this is the closest I got:

sudo su
  # mount USB pen
mount /dev/sd[X]1 /media/usb
  # install GRUB
grub-install --force --no-floppy --root-directory=/media/usb /dev/sd[X]
  # copy ISO image to USB
cp ~/ubuntu-10.10-server-amd64.iso /media/usb
  # mount ISO image, copy existing grub.cfg
mount ~/ubuntu-10.10-server-amd64.iso /media/iso/ -o loop
cp /media/iso/boot/grub/grub.cfg /media/usb/boot/grub/

I then edited /media/usb/boot/grub.cfg to add an .iso loopback, example grub entry:

menuentry "Install Ubuntu Server" {
  set gfxpayload=keep
  loopback loop /ubuntu-10.10-server-amd64.iso
  linux (loop)/install/vmlinuz  file=(loop)/preseed/ubuntu-server.seed iso-scan/filename=/ubuntu-10.10-server-amd64.iso quiet --
  initrd (loop)/install/initrd.gz
}

When booting from USB, this would give me the Grub boot menu and start the installer, but the installer gave up after a couple of screens complaining that it couldn't find the CD-ROM drive. (Naturally, as the box I'm installing on doesn't have an optical drive.)

I resolved this particular issue by giving up and doing the "create USB drive" routine using the Ubuntu Live desktop CD (on a computer that does have an optical drive), then the USB install works.

But I expect that there is some way to do this from the command line of an Ubuntu system without X server and without an optical drive, so the question still stands.

Does anyone know how?

Have you tried with # dd if=path/to/image.iso of=/dev/sd#  ?

You can install a command line (CLI) Ubuntu using the Alternate Install or Mini iso (which should fit on your 512mb stick)

Then install Crunchbang using the alternate method: http://crunchbanglinux.org/forums/topic/26/crunchbang-linux-81001-alternative-installation/

You could also try the Lite version of CrunchBang, which is less than 512mb.

You could use Unetbootin to prepare the USB stick.


install ubuntu in a virtualbox vm on ubuntu host through cli (ssh) only? I just installed a new remote server with ubuntu 14.04, added an SSH server so I can control the server remotely through SSH. No GUI involved. Well, the server has a GUI, but I have no physical access to it.

I also installed virtualbox (using "sudo apt-get install virtualbox") and now I want to create a virtualbox VM, and install ubuntu in there as well. Is it possible to do this entirely through ssh only? Or would I need some visual/graphical interface to the VM (and thus, also to the host machine) as well?

The hard way - Install on a headless Virtual Box
It is possible to install Ubuntu in Virtual Box running on a headless server.
The following guide helps a lot in setting up a virtual machine from the command line (and through SSH):

Virtual Box Manual: Remote Virtual Machines

This involves viewing the virtual machine's output with VRDP.
In case we can not do this we will need an unattended installation of Ubuntu:

How can I install Ubuntu on a device without a screen nor a keyboard?
How do I create a completely unattended install of Ubuntu?
How can I install Ubuntu on a headless machine?

By this we will install Ubuntu without user input on booting the remotely created VM from an installation ISO file.
The easy way - Import an existing VM to the remote Virtual Box
From above we can see that it may be much easier to set up our virtual machine on a local box to then just export the appliance. After uploading the OVF appliance to our server we can then import it to virtual box running there simply with:
VBoxManage import <name>.ovf [--dry-run] [<options>]

The option --dry-run will give you information on how the appliance will be imported, and you will also see further options on how to influence this.

You should look at the VirtualBox documentation, it may be possible to do what you want from the command line, but I don't think it will be a straight forward process.

The easiest would probably be to tunnel X through SSH: Just log in with ssh -X and you can open graphical programs - their window will open on your local computer.

For console only access qemu would probably better suited because it's actually supposed to be used on the command line.


How do I remap the caps lock key? In the the past I used to use xmodmap to prevent the Caps Lock button from working, and then tell Launchy to handle the key press instead. I can't seem to do this anymore.

What is the best way to disable Caps Lock's normal behavior, and make it do something else?

From howtogeek.com which has a good answer for any OS.

For Linux (including Ubuntu):

setxkbmap -option <OPTION>

Where <OPTION> can be for example of:

caps:none – Disables Caps Lock.
caps:super – Caps Lock becomes an additional Super (aka Win key).
caps:ctrl_modifier – Caps Lock becomes an additional Ctrl.
caps:numlock – Caps Lock becomes an additional Num Lock.
caps:escape – Caps Lock becomes an additional Escape.
caps:backspace – Caps Lock becomes an additional Backspace.
caps:swapescape – Caps Lock becomes Escape, and Escape becomes Caps Lock

Note: Xmodmap is deprecated in favor of setxkbmap.

The most robust solution is to buy a keyboard that lets you remap keys in firmware, i.e. a professional, programmable keyboard.

These usually cost around 200 bucks and also have high grade mechanical keyswitches. They are expensive, but they are the only way to avoid having to fight with this at every new machine you sit down at, and each time the developers make breaking changes to OS infrastructure as fundamental as the keyboard map.


Unable to connect to: ws://hostname:5240/MAAS/ws My MAAS server has been running for several months, building OpenStack cloud configurations and tearing them down, but then it starts giving the error message

Unable to connect to: ws://hostname:5240/MAAS/ws

when going to to the node list.

I have tried rebooting the server, reconfiguring maas-region-controller, everything I can think of.  I can telnet to the port and something is definitely listening on it.

How do I recover from this?  My only successful method in the past has been to wipe the disk and do a total reinstall and reconfigure, starting over.  This happens regularly.

I needed to make certain that port 5240 was available between my desktop and the maas server.  It was not open which caused the failure.  After making port 5240 available it worked fine.

Edited:
You can access it directly from http://hostname:5240
I successfully accessed it directly even though http://hostname/MAAS/ giving those errors.


Skype notifications are muted I can hear skype calls just fine, but notifications seem to be muted.  I've gone into my sound settings and whenever a notification appears, a "Skype" appears under "Applications," and it is muted.  Pressing "mute" doesn't do anything, and whenever I slide the volume up, it snaps back to 0%.
I don't seen anything that could be causing it in my .Skype folder.  Any ideas?

In the Skype options->Notifications, did you make sure the checkbox was checked for "Play sound file:"?

If so, did you try highlighting the notification that doesn't work, and checking "Enable Event", and then using the "Test Event" button?  If the sound does not play, try going to the directory specified for the file (/usr/share/skype/sounds by default) and making sure you can play the sound.

If not, then you may be missing a codec or something, and you can concentrate on getting that filetype to work (try other similar files).

Edit
added one more step...  I played around with my setup, using the Skype "Test Event" button with the sound settings open.  I found that I could quickly check the mute checkbox in the applications section when it appeared - I used the "Call Connecting" event; strangely enough, many of the events never appeared in this window.  The seem to be controlled by the "Alert Volume" in the "Sound Effects" tab of this same settings dialog.  I remember having problems at first when this volume control slider was too low, and many Skype sounds didn't work.  Are all the sounds muted in the "Test Event" page?

I had the same problem. It took me a while to fix it. Apparently Skype has at least two possible entries in the Windows Mixer app. If you are logged in to Skype and have the main window open, the entry will be labeled "Skype - yourname", but if you have the Skype Options panel open the title changes to "Skype Options". My problem was that somehow the volume for "Skype Options" was muted and the only place where this is shown is in the Mixer App and then only when the Options page is active.


How do I resolve a "Cannot open shared object file libudev.so.0" error? Trying to run Game Dev Tycoon on Ubuntu 64. It asks for the above object.

I ran sudo apt-get install libudev1:i386 and it came back already installed.

I have /lib/i386-linux-gnu/libudev.so.1 but no libudev.so.0 anywhere.

To fix, I linked libudev.so.1 to libudev.so.0:

sudo ln -sf /lib/$(arch)-linux-gnu/libudev.so.1 /lib/$(arch)-linux-gnu/libudev.so.0

Run these commands in a terminal:

cd /lib/x86_64-linux-gnu/
sudo cp libudev.so.0.13.0 libudev.so.1

This has helped me


HDMI is not working in Ubuntu 16.04 I tried connecting my Ubuntu laptop to my TV via HDMI, apparently it`s not working. I already tried below options:

1.Run sudo apt-get purge nvidia-*

2.Run sudo add-apt-repository ppa:graphics-drivers/ppa

3.Run sudo apt-get update

4.Run sudo apt-get install nvidia-364 (Check what's the latest version... in my case as July 2017 nvidia-381 was avaliable)

But this does not work for me. My TV, Laptop and HDMI cable are fine, as I am easily able to use HDMI and connect to TV using WINDOWS OS

System Details Shows:

Processor: Intel® Core™ i5 CPU M 480 @ 2.67GHz × 4
Graphics: Intel® Ironlake Mobile

I checked few more links and I found some commands, thought might be helpful, hence sharing the O/P

~$ lsmod | grep -i DRM
drm_kms_helper        151552  1 i915
syscopyarea            16384  1 drm_kms_helper
sysfillrect            16384  1 drm_kms_helper
sysimgblt              16384  1 drm_kms_helper
fb_sys_fops            16384  1 drm_kms_helper
drm                   352256  7 i915,drm_kms_helper

~$ lspci -k | grep -A 2 -i "VGA"
00:02.0 VGA compatible controller: Intel Corporation Core Processor Integrated Graphics Controller (rev 18)
Subsystem: Dell Core Processor Integrated Graphics Controller
Kernel driver in use: i915

Let me know if any other details needed. Please help !!

Redirecting Audio can become quite difficult in some cases.

For example my firefox never liked to play audio thru hdmi while all other software did. Since i use pulse audio, it works like charm; check the end of this answer.

I am using Lubuntu 16.04. It might be different from your desktop, but automatic switching never occured by default. I always had to direct the audio stream manually. In general you have at least two audio-outputs: One analoge audiojack and one digital hdmi, in general on different audio-cards.

The hard way:

First i had to get an overview on the audiocards installed on my htpc (ati motherboard with onboard graphics and onboard cpu):

aplay -l

**** List of PLAYBACK Hardware Devices ****
card 0: Generic [HD-Audio Generic], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: SB [HDA ATI SB], device 0: ALC887-VD Analog [ALC887-VD Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: SB [HDA ATI SB], device 3: ALC887-VD Digital [ALC887-VD Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

and all the possible audio-streaming channels i could route the sound:

aplay -L

null
    Discard all samples (playback) or generate zero samples (capture)
pulse
    PulseAudio Sound Server
hdmi:CARD=Generic,DEV=0
    HD-Audio Generic, HDMI 0
    HDMI Audio Output
dmix:CARD=Generic,DEV=3
    HD-Audio Generic, HDMI 0
    Direct sample mixing device
dsnoop:CARD=Generic,DEV=3
    HD-Audio Generic, HDMI 0
    Direct sample snooping device
hw:CARD=Generic,DEV=3
    HD-Audio Generic, HDMI 0
    Direct hardware device without any conversions
plughw:CARD=Generic,DEV=3
    HD-Audio Generic, HDMI 0
    Hardware device with all software conversions
default:CARD=SB
    HDA ATI SB, ALC887-VD Analog
    Default Audio Device
sysdefault:CARD=SB
    HDA ATI SB, ALC887-VD Analog
    Default Audio Device
front:CARD=SB,DEV=0
    HDA ATI SB, ALC887-VD Analog
    Front speakers
surround21:CARD=SB,DEV=0
    HDA ATI SB, ALC887-VD Analog
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=SB,DEV=0
    HDA ATI SB, ALC887-VD Analog
    4.0 Surround output to Front and Rear speakers
surround41:CARD=SB,DEV=0
    HDA ATI SB, ALC887-VD Analog
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=SB,DEV=0
    HDA ATI SB, ALC887-VD Analog
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=SB,DEV=0
    HDA ATI SB, ALC887-VD Analog
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=SB,DEV=0
    HDA ATI SB, ALC887-VD Analog
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
hdmi:CARD=SB,DEV=0
    HDA ATI SB, ALC887-VD Digital
    HDMI Audio Output
dmix:CARD=SB,DEV=0
    HDA ATI SB, ALC887-VD Analog
    Direct sample mixing device
dmix:CARD=SB,DEV=3
    HDA ATI SB, ALC887-VD Digital
    Direct sample mixing device
dsnoop:CARD=SB,DEV=0
    HDA ATI SB, ALC887-VD Analog
    Direct sample snooping device
dsnoop:CARD=SB,DEV=3
    HDA ATI SB, ALC887-VD Digital
    Direct sample snooping device
hw:CARD=SB,DEV=0
    HDA ATI SB, ALC887-VD Analog
    Direct hardware device without any conversions
hw:CARD=SB,DEV=3
    HDA ATI SB, ALC887-VD Digital
    Direct hardware device without any conversions
plughw:CARD=SB,DEV=0
    HDA ATI SB, ALC887-VD Analog
    Hardware device with all software conversions
plughw:CARD=SB,DEV=3
    HDA ATI SB, ALC887-VD Digital
    Hardware device with all software conversions

Now I needed to find out, which of these channels is used by my hdmi cable. Therefor I needed an audioplayer that allowed me to route the audio manually  to test each of the above channels, one by one, until i found out, which of them belongs to my hdmi. With a GUI vlc and especially audacious come in handy. On CLI basis we could also use aplay, but i am not familiar with that.

Now, after having found out, which channel belongs to my hdmi cable, it was card 0, device 3, i needed to create a file in my homefolder .asoundrc Asound Wiki with the information what card, and what device to use.

pcm.snd_card {
        type hw
        card 0
        device 3
}

ctl.snd_card {
        type hw
        card 0
        device 3
}

Also i needed to run 'alsamixer'. With F6 i did select my soundcard and had to navigate with the arrow keys to the S/PDIF and activate (unmute) it with the M key.

After a reboot audio thru hdmi worked, but firefox remained unwilling to play audio via hdmi.

Long story short, now i use PulseAudio and i am very happy with it.

The easy way

Since i installed PulseAudio the handling of the audio devices has become very easy.
I would suggest you to install:
sudo apt-get install gstreamer1.0-pulseaudio pavucontrol pulseaudio-module-x11

pavucontrol is a comfortable GUI to (re)direct your audio-streams to the device/channel you want.

I hope this helps you to find a solution.

What's worked for me is on the system settings, display, set your tv as primary monitor. And you've to do the same for the sound, click on the hdmi card and apply.


Running useradd with shell_exec After trying to give permissions to /etc/passwd, the useradd command wont execute from php's shell_exec();
I also tried to visudo and change passwd's owner, the error is still

useradd: Permission denied.
useradd: cannot lock /etc/passwd; try again later.

How to create bash user accounts with php ?

The problem is with APACHE user permissions.
You can either give sudo permissions to your script which is not the best idea, security-wise.
Or use ssh2_connect to connect to your server with ssh and run only useradd as root.

$connection = ssh2_connect('localhost', 22);
if (ssh2_auth_password($connection, 'root', '')) {
    $username = 'username';
    $password = 'password';
    ssh2_exec($connection, "useradd $username -m -p $password -d /home/$username/ -s /bin/false");
} else {
    die('Authentication Failed...');
}

See ssh2_connect and ssh2_auth_password docs.


Script that will reboot PC on specific GPU temp Recently I've started mining litecoins. My miner consists of 3 Radeon R9 290x GPUs. From time to time one of them (not a specific one, it happens randomly) stops mining. Usually restarting cgminer (mining program) doesn't help, the only thing that helps is reboot. Next week I'm leaving for 8 days and I have nobody to do that for me so I thought of a script that would do that automatically.

The script would have to periodically verify if all GPUs are working and if not - reboot.
I think temperature reading is the easiest thing to determine if all cards are working. I know how to read temperature, reboot, add stuff to cron. What I don't is how to put it all together.

Get temperature command:

 aticonfig --odgt --adapter=all | grep Sensor:

Output looks like this:

 Sensor: Temperature - 77.00 C
 Sensor: Temperature - 77.00 C
 Sensor: Temperature - 77.00 C

I would like the script to read the numerical value and reboot if it drops below XX.

Can you please help me out?

Save this a script and make it executable (chmod +x scriptname.sh) and run it with bash using sudo as reboot requires root.

#! /bin/bash
while :
do
    temp=$(aticonfig --odgt --adapter=all | grep Sensor: | sed 's/[a-zA-Z:-]//g'|  tr -d ' ')

    action=$(echo $temp|awk '{ print ($1 < 76) ? "reboot" : "" }')

    $action
    sleep 1
done

I have not tested it with the ATI command as I don't have access to the command, but it works replacing aticonfig --odgt --adapter=all | grep Sensor: with echo 'Sensor: Temperature - 77.00 C'. This was how I tested it.

The 76 is the restart temp. You can edit that.

This should work:
#!/usr/bin/env bash
while true; do
  aticonfig --odgt --adapter=all |
   awk -vt="$1" '(/Sensor:/ && $(NF-1) < t ){exit(1)}' || reboot
   sleep 10
done

Save the script above as gpu_temp.sh, make it executable and run it with the temperature limit you want as an argument:
/path/to/gpu_temp.sh 77

I don't have an ati card so I can't test this but that should cause your machine to reboot if a GPU core falls below 77 °C.

Explanation

The while true starts an endless loop, the script will run until killed.
The awk line checks if the next to last field (($NF-1)) of lines containing Sensor: is less than whatever you chose and, if so, exits with exit status 1.
The command to the right of || will be  executed if the command on the left failed, if it exited with non-zero status. So, if one if the cores is below a certain temperature, the awk script will fail and the system will be rebooted.
sleep 10 just pauses the script for 10 seconds so you don't flood your system with requests.


Ubuntu is not detecting my android device I am new to android. I have just downloaded and installed android sdk. Now when I run the application from  eclipse, my device is not getting detected. I have googled and was brought up with this as my solution, but that also didn't worked.

Here's the 51-android.rules

SUBSYSTEMS=="usb", ATTR{idProduct}=="0bb4",  ATTR{idProduct}=="0c03", MODE="0666", GROUP="plugindev", OWNER="<username>"

After that I rebooted my laptop, and ran this command:

username@laptopname:~/Android/adt-bundle/sdk/platform-tools$ adb devices

The output i get is:

* daemon not running. starting it now on port 5037 *
* daemon started successfully *
List of devices attached
????????????    no permissions

EDIT

crazydeveloper@crazydeveloper:~$ lsusb
Bus 002 Device 004: ID 0bb4:0c03 HTC (High Tech Computer Corp.)
Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 003: ID 04f2:b337 Chicony Electronics Co., Ltd
Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
crazydeveloper@crazydeveloper:~$ ls -l /dev/bus/usb/004/
ls: cannot access /dev/bus/usb/004/: No such file or directory
crazydeveloper@crazydeveloper:~$

Edit: 2

After the answer submitted here's the output that i got:

crazydeveloper@crazydeveloper:~$ ls -l /dev/bus/usb/002
total 0
crw-rw-r--  1 root root    189, 128 May  7 09:45 001
crw-rw-r--+ 1 root root    189, 129 May  7 09:45 002
crw-rw-rw-  1 root plugdev 189, 130 May  7 09:48 003

I am using Micromax Canvas 2.2 A114 - Android Version 4.2.2

Please help me. Thanks.

OK here are all the steps to get this to work. I had problems with all responses I found online, bits and pieces everywhere without any certain order and no single working solution, (running Android Studio, Jmonkey 3D, and Ubuntu 14.04)

If adb devices shows android device as ????????? (no permissions) follow these instructions:

create file /etc/udev/rules.d/51-android.rules

sudo gedit /etc/udev/rules.d/51-android.rules

copy and paste contents below:

SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0e79", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0502", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0b05", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="413c", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0489", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="091e", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="18d1", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0bb4", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="12d1", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="24e3", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="2116", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0482", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="17ef", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="1004", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="22b8", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0409", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="2080", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0955", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="2257", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="10a9", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="1d4d", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0471", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="04da", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="05c6", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="1f53", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="04e8", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="04dd", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0fce", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="0930", MODE="0666", GROUP="plugdev"
SUBSYSTEM=="usb", ATTRS{idVendor}=="19d2", MODE="0666", GROUP="plugdev"

Run the following command to change file permissions:

sudo chmod a+r /etc/udev/rules.d/51-android.rules

connect your phone via usb and run the following command:

lsusb

Look for your device(s) Example (Nexus 5):

  Bus 003 Device 074: ID 18d1:4ee7 Google Inc.

For Nexus 5, Vendor ID is 18d1, mine is on Bus "003" If you don't see a change when you plug in your device with lsusb, perhaps your USB cable is charge-only.
Now reload the rules with the following commands:

sudo udevadm control --reload-rules
sudo service udev restart
sudo udevadm trigger

Verify device is now allowing plugdev user group access

ls -l /dev/bus/usb/<bus number from step 4>

Example:

ls -l /dev/bus/usb/003
crw-rw-rw- 1 root plugdev 189, 329 Jul  3 18:23 074

Run adb devices to confirm permissions are correct and enjoy!

Note: if you haven't created the plugdev group and added your user name to it (if permission denied prepend "sudo" following commands):

Add plugdev group:

groupadd plugdev

Add your username to plugdev group (useradd -G {group-name} username):

useradd -G plugdev billy

Restart udev (you may need to log off and log back in to update user group):

sudo service udev restart

It should be like this:

SUBSYSTEM=="usb", ATTR{idVendor}=="0bb4", ATTR{idProduct}=="0c03", MODE="0666"


Mass printing ODT documents Is there a faster way to print multiple ODT documents besides opening each one in OpenOffice/LibreOffice and printing each document separately? It would be great if I could just select multiple documents in Nautilus and have some option to print them all with the same print settings.

First, in Nautilus select the relevant .odt documents...

UPDATE:
You can fully "automate" the process by adding a Nautilus Action
sudo apt-get install nautilus-actions

eg (nautilus-actions setup):
Command: ooffice -writer -p -headless
Parameters: %M
Filenames: *.odt
[*] Appears if selection has multiple files of folders

or:
here is my original "Terminal" version

In Nautilus copy selected files to the clipboard (filenames are stored)...

Set up your required printer settings in OpenOffice...

In gnome-terminal, use the context-menu item Paste Filenames ...
Note: the pasted filenames are: 'single-quoted' and space delimited

ooffice -writer -p 'YOUR' 'PASTED' 'FILENAMES' &

I don't know how long a Terminal command-line can handle, but it does work..
(I just tested it;  printing to a cups-pdf virtual "printer")

On newer versions of Ubuntu featuring LibreOffice instead of OpenOffice be sure to use the libreoffice-command instead.

on libreoffice you might also have to use "--" instead of "-", the full command then is:

libreoffice --writer -p --headless 'filename1' 'filename2'

What I think you need is a batch convert to get all your documents into pdf:

http://www.xml.com/pub/a/2006/01/11/from-microsoft-to-openoffice.html

Once you have pdf files, it's much easier to send them all to the printer, by joining them all up into one big pdf using pdftk or by using the normal print option.


bash: ./install.sh: Permission denied installing intel fortran 2011 I am trying to install Intel Fortran Composer 2011. When I try to command ./install.sh it gives an error:
bash: ./install.sh: Permission denied

I tried some ways to get pass this.

Tried; sudo ./install.sh
sudo: ./install.sh: command not found

Trying to remount the installation disk with exec permission;
mount /media/user/IFORTRAN2011 -o remount,exec

Trying to change install.sh to executable;
chmod +x ./install.sh

Tried;
su -c 'install.sh'

with root:
bash: install.sh: command not found

with user:
Password:
su: Authentication failure

and I am sure the password is true. (If it is the same with my user password)
5 . I copied the disk into a folder than compressed it into

file.tar.gz

than extract it with
tar xvzf file.tar.gz

then tried everthing again. No luck.
After I did     chmod +x ./install.sh when I look the permissions with: ls -l ./install.sh it still gives:
-rw------- 1 user user 14758 Oct  7  2010 ./install.sh
Thanks for any help.

There is many way to execute your script :

launch bash with root privilege sudo bash install.sh
change permissions to launch the script. However be careful, it's an installation script, it may require root privileges. So you must probably run it as root.

chmod +x install.sh or chmod 755 install.sh

just go and right click on the file, choose properties, go to the Permissions, and check the Execute: Allow executing file as program.


I can't install ubuntu... it just boots to windows! I am trying to install Ubuntu alongside windows and it won't work. I go through the installation process and it says to remove installation media and close tray. Then press enter. When I do this the computer restarts like normal and then boots to windows!

most ppl are smarter than me. But this is how I did it: log in in windows. go to unetbootin.sourceforge.net  download GParted, while you are at unetbootin, make a bootable cd, or usb (of 4 gb size at least) with Ubuntu 14.04 on it, then go back to windows desktop. take out cd, or usb and set it down beside you.  start GParted, and make a seperate partition for ubuntu. I split my HDD 50/50. when you are done with the partitions, close all programs, and then shut down computer. insert cd, or usb and restart computer (be sure to enable boot from cd or usb in bios) press F12 or F2 when given the option. if you did things right, you should boot from cd, or usb. you will then be able to install ubuntu onto the new partition on your HDD, from the cd or usb.  There are great articles on how to use GParted on the web or at unetbootin... I printed the article called "Using GParted" that is at unetbootin. it has screen shots and step by step instructions, to help get you up and running in no time. using_gparted.txt  by patrick. take my advice and learn all you can about GParted FIRST... and have fun


Mouse Wheel doesn't work My wireless Mircosoft Mouse Mouse Wheel gets not recognized by the System.
I tried xev for checking if its just a setting-problem, but there happing nothing either... Clicking with it works, but scrolling not.
I'm using Ubuntu 17.04 Gnome and Unity 7, but had the same Problem also at 16.10

The solution described in another post worked for me in Ubuntu 18.04:

sudo apt install --install-recommends linux-generic-hwe-18.04 xserver-xorg-hwe-18.04

I just solved this problem on Ubuntu 18.04 with doing Natural Scrolling on and off again. Path is Settings>Devices>Mouse&Touchpad>Natural Scrolling.


I can't install a .sh file I can't install a .sh file. When I double click the file then it is open with archive manager not get any run or run in terminal option.

I also checked the permission on allow executing file as program

To run .sh file, using a terminal is the best way.

Assuming your file is in /home/user/downloads directory;

To open a terminal press ALT+CTRL+T together. Once the terminal is opened, type pwd to locate which directory currently you're in. pwd will display an output like below

/root/folder/

If your .sh file is in user's downloads directory as I mentioned above, then use cd command to navigate to the downloads folder. see below;

cd /home/user/downloads

once entered, again check whether you're in that directory by using pwd command. If you're in that directory then simply type ls command to list down the files. Once you see your .sh file, simply type below command to execute the file.

sudo sh shell_file.sh

terminal will ask you to type the root (admin) password which will not be visible while you type. simply type the password & enter. That's it, the execution will process.

This is just an assumption; assuming your file located in a directory. I hope this very basic and simplified process which will make you more clear.

Hope it helps! :)

EDIT: I've edited the document by adding sh command at the last step.

first give full permission to that .sh file

sudo chmod 755 YOUR_FILENAME

second run .sh file by following command inside ur CLI

sudo ./YOUR_FILENAME

**YOUR_FILENAME is full path of your file, where it is situated.


Archive manager which has integration into Nemo except File Roller (Archive Manager)? I mean something like "Extract Here" and "Compress..." menus on right-click.

Actually, Nemo can be integrated with the default archive manager shipped with Unity. Webup8 provides Nemo with a series of extensions that integrates it tightly with Unity. The steps are:

sudo add-apt-repository ppa:webupd8team/nemo
sudo apt-get update
sudo apt-get install nemo nemo-fileroller
sudo apt-get install nemo-compare nemo-dropbox nemo-media-columns nemo-pastebin nemo-seahorse nemo-share nemo-emblems nemo-image-converter nemo-rabbitvcs

After this, among many other improvements, you should have the "Extract Here" and "Compress..." options in the context menu.


MD5 mismatch on my 12.04 ISO, what is going on? I downloaded ubuntu-12.04-desktop-amd64.iso from  http://releases.ubuntu.com/precise/

This page also has a link to file showing the respective MD5 hashes for each file

The page shows

128f0c16f4734c420b0185a492d92e52 *ubuntu-12.04-desktop-amd64.iso

But when I checked my downloaded ISO using the md5sum program I get

57876b3740ee89e75c8fefc93a7ceee6 *ubuntu-12.04-desktop-amd64.iso

I also downloaded the ISO via BitTorrent using
http://releases.ubuntu.com/precise/ubuntu-12.04-desktop-amd64.iso.torrent

This time using md5sum for this file shows the correct hash 128f0c16f4734c420b0185a492d92e52, but the ISO is 732MB, not 698MB as shown on the release page.

What could be happening here?

So, firstly, sorry for the confusion here.  Fundamentally it came down to a communication glitch between the release team and our sysadmins.

Around release time, we push many of our images out to Amazon's CloudFront service to keep our bandwidth use under control.  releases.ubuntu.com is managed directly by the release team, but the images on CloudFront are pushed by our sysadmins, and we have to push there well in advance to make sure everything's in place.  The sysadmins pushed the most recent daily build at the time, but after that we had to respin images for some serious bugs, and we forgot to let the sysadmins know about this so that they could update CloudFront.  As a result, you were getting out-of-date versions.

We've pushed updated images to CloudFront now, and all should be well, although I'm going to check things over manually just to make sure.

Your initial download was incomplete or corrupted.  BitTorrent verifies the downloaded data to make sure it is correct, which you have verified with md5sum.  The size difference is just the Megabyte vs. Mebibyte issue.


How do you clear, delete, or hide a portion of your history in the Terminal? clear will not work, because that clears your screen. What I am looking to do is just hide, delete, or obfuscate a portion of history on my display in my session, namely a command that I inputted that I do not want the user to see.

So take that as an example; I want to hide what is circled in red, but keep everything above and below it in view.

OK, first of I think this is what you need: tput command . Basically it allows user to redraw the screen without closing the session. Look at the screen capture of my terminal window:

Basically, I executed command ls *.c just to fill the screen with something. Then I execute command tput cup 4 0; echo "THIS LINE WILL BE COVERED WITH THIS ALL CAPS TEXT :)" , and that basically places your prompt onto line 4 column 0, and executes echo to cover line 5 row 0. This will stay there even if you scroll back.

Now , suppose you just have executed the command you dont wanna user to see. So for instance, I executed iwconfig, but do not wanna user to see my WI-FI name. I execute command and count which line it is on. In my example the wlan0 ESSID was on line 7, so I execute tput cup 6 4; echo "I DO NOT WANT USER TO SEE THIS PART".

Now pay attention, because this only redraws the screen ! The actual command remains in the .bash_history file. After you done with the session, you can re-open the terminal and manually delete the line you do not want. If I execute ls command and scroll back, that part of screen is still obfuscated.

Among other things I've found, tput reset clears screen completely, and if you wanna hide just output, pipe the output into /dev/null. For instance echo "This will never show on screen" > /dev/null

Old answer:  In dropdown menu go to Edit -> Profile Preferences -> Scrolling tab.

Change number of Scrollback lines to whatever you desire. The terminal wont scroll back beyond that value of lines you entered in the terminal.

For instance, my terminal window is about 41 lines long, but since I've set it to only 10 lines of scroll back, the terminal does not scroll back at all.

First make sure you close all terminal windows and shell sessions.

Then open file ~/.bash_history in gedit ( or anoter GUI editor) and delete the lines you do not want.


Run PHP script from command line? How can I simply run a PHP script in the command line? Also is it possible to run it like it would be if the URL was typed in?

As long as you have php installed, you run a PHP file using

/usr/bin/php /path/to/php/file.php

Or if your $PATH is set up properly to include /usr/bin, then simply

php /path/to/php/file.php

You can check if PHP is installed, by running

which php

If SSH disabled:
<?php
$output = shell_exec('which php');
echo "<pre>$output</pre>";
?>


How do I install remastersys? I was following instruction from http://www.remastersys.com/ubuntu.html to install remastersys in my system. On apt-get update always get error that the could not find correct structure of URL.

Any help?

You can install Remastersys in Ubuntu 12.04

As root - issue

'sudo su'

in the terminal window prior to the following command.

wget -O - http://www.remastersys.com/ubuntu/remastersys.gpg.key | apt-key add -

sudo gedit /etc/apt/sources.list

Add the following line

#Remastersys Precise
deb http://www.remastersys.com/ubuntu precise main

Now open the terminal and type

sudo apt-get update && sudo apt-get install remastersys remastersys-gui

Here is the screenshot

Source: http://www.remastersys.com/ubuntu.html

Minimal Ubuntu i386 32 bits installation with apt repositories.

I've managed to install remastersys on a
Minimal Ubuntu i386 32 bits.

1. Adding remastersys repository as Eliah and Tachyons posted:

You can install Remastersys in Ubuntu 12.04

As root - issue

sudo su

in the terminal window prior to the following command.

wget -O - http://www.remastersys.com/ubuntu/remastersys.gpg.key | apt-key add -

sudo gedit /etc/apt/sources.list

Add the following line

#Remastersys Precise deb http://www.remastersys.com/ubuntu precise main

2. Installing remastersys and its dependencies :

sudo apt-get update && sudo apt-get install kpartx-boot kpartx kpartx cryptsetup cryptsetup-bin dmraid libdmraid1.0.0.rc16 kpartx-boot ecryptfs-utils libecryptfs0 libnss3-1d lvm2 libdevmapper-event1.02.1 watershed ubuntu-drivers-common python3-xkit bogl-bterm ncurses-term samba-common keyutils libvte-common libparted-fs-resize0 ubiquity-artwork-2.20.0 ubiquity-casper rdate ecryptfs-utils cryptsetup python3-icu python3-pam archdetect-deb dpkg-repack apt-clone dmraid btrfs-tools ubuntu-drivers-common lvm2 localechooser-data cifs-utils libvte9 mtools syslinux-common ubiquity bogl-bterm  memtest86+ casper libdebian-installer4 ubiquity-frontend-debconf user-setup syslinux xresprobe  squashfs-tools remastersys remastersys-gui

Thanks to all you people who have been working within these projects!


wifi adapter disabled I am using Lenovo idea pad with windows 10, I have dual booted the laptop with ubuntu 18.04, I am unable to connect to wifi"wifi adapter not found", To rectify the issue I need to install the drivers through a wired connection, but my laptop does not have an ethernet port . Is there any other way to solve the issue. Kindly help me.

Locate the drivers on your phone or via another device and upload it via USB cable or USB flash drive.

Solved

Also, search on here before asking. This has been asked many times and I have found many solutions on here.


Error while installing Jitsi I am not very knowledgeable when it comes to Ubuntu. I wanted to install Jitsi because I didn't know there's a web application. While installing I came across an error which I tried to resolve but didn't managed to. And because I was told it was accessible via browser I ignored it. Now I want to customize my terminal but when trying to install new packages there is the following error:

The given hostname does not exist in the config
dpkg: error processing package jitsi-meet-prosody (--configure):
 installed jitsi-meet-prosody package post-installation script subprocess returned error exit status 1
dpkg: dependency problems prevent configuration of jitsi-meet:
 jitsi-meet depends on jitsi-meet-prosody (= 1.0.3928-1); however:
  Package jitsi-meet-prosody is not configured yet.

dpkg: error processing package jitsi-meet (--configure):
 dependency problems - leaving unconfigured
dpkg: dependency problems prevent configuration of jitsi-meet-turnserver:
 jitsi-meet-turnserver depends on jitsi-meet-prosody; however:
  Package jitsi-meet-prosody is not configured yet.

dpkg: error processing package jitsi-meet-turnserver (--configure):
 dependency problems - leaving unconfigured
No apport report written because the error message indicates its a followup error from a previous failure.
                                No apport report written because the error message indicates its a followup error from a previous failure.
                                                                Errors were encountered while processing:
 jitsi-meet-prosody
 jitsi-meet
 jitsi-meet-turnserver
E: Sub-process /usr/bin/dpkg returned an error code (1)

Try doing a complete uninstall using:

apt-get purge jigasi jitsi-meet jitsi-meet-web-config jitsi-meet-prosody jitsi-meet-turnserver jitsi-meet-web jicofo jitsi-videobridge2

Then, so a reinstall, using the instructions here:

https://jitsi.org/downloads/ubuntu-debian-installations-instructions/

Specifically:

sudo apt-get -y install jitsi-meet

from a terminal window.

IMPORTANT: when prompted to input your FQDN for DNS configuration, using something like meet.jit.si, not localhost.

Here's the URL of the page where I saw this:

https://github.com/jitsi/jitsi-meet/issues/5053/

Test your installation by loading your browser (e.g., Chrome or Safari) and joining an existing jitsi meeting, or go to meet.jit.si to create a new one.

This is a tentative answer intended to be informative and might lead to a solution.  This answer is in the context of my attempts to install the Desktop GUI for Jitsi which seems to have its own problems:
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package jitsi

notably, this error is for jitsi (client) rather than jitsi-meet (server).
Although even that error isn't fully established.
My speculation is that perhaps the above potential problem has a direct, or even indirect, bearing on the stated problem with installing (or removing) jitsi-meet with apt as above.
The linked answer is:

Jitsi's documentation appears to be (currently?) inaccurate. Today the
Packages file downloaded from
http://download.jitsi.org/stable/Packages in the end provides only
theses packages (in multiple versions and architectures):
$ grep-dctrl -F Package -s Package --regex '.*' < Packages | uniq
Package: jibri
Package: jicofo
Package: jigasi
Package: jitsi-archive-keyring
Package: jitsi-meet-prosody
Package: jitsi-meet-tokens
Package: jitsi-meet-turnserver
Package: jitsi-meet-web-config
Package: jitsi-meet-web
Package: jitsi-meet
Package: jitsi-upload-integrations
Package: jitsi-videobridge2
Package: jitsi-videobridge

There's no jitsi package.
However the jitsi package does exist in the nightly builds
(reached by replacing the word stable with unstable in the
sources.list file).
To be thorough, in April 2020 there was a snapshot made by
archive.org of the stable repository, which did include the
jitsi version 2.10.5550-1 package, dated from 2017. So I can only
conclude that it was removed for some unknown reason from the stable
repository.
This former missing 2.10 stable package is still available through
this other Jitsi web page and the linked URL:
https://desktop.jitsi.org/Main/Download.html
https://github.com/jitsi/jitsi/releases/download/Jitsi-2.10/jitsi_2.10.5550-1_amd64.deb
Or else you can add the jitsi nightly builds to get the 2.11.x
versions:
sudo sh -c "echo 'deb https://download.jitsi.org unstable/' > /etc/apt/sources.list.d/jitsi-unstable.list"

(as the package jitsi-archive-keyring is the same in the unstable
repository and would also install
/etc/apt/sources.list.d/jitsi-stable.list with the stable version
url, it makes sense to use a different file to avoid it being
overwritten)
There appears to be some inconsistency between the different methods
available.
which is provided in the event that, as pointed out, the original
answer gets deleted or otherwise lost in the shuffle.


Ubuntu 20.04 Nvidia Drivers Laptop Dual Graphics Not Installing Edit Due to the time sensitive nature of my issue (I needed the gpu asap) I ended up just installing arch (manjaro) and it was able to recognize and install Nvidia Prime drivers (440). However, Thanks for all the help.
I have searched and searched and cannot find any solutions to my specific problem. Basically, I have an Asus Zenbook UX303ub, which shipped with an i7 6th gen, and an Nvidia GT940m. I'm running Ubuntu 20.04, and I can't seem to get the Nvidia GPU to run. Here is what I have done so far
sudo ubuntu-drivers devices -> No output

I have tried using the Nvidia drivers here, which is the nvidia-346 version if I'm not mistaken. The installation fails with
ERROR: Installation has failed.  Please see the file '/var/log/nvidia-installer.log' for
       details.  You may find suggestions on fixing installation problems in the README
       available on the Linux driver download page at www.nvidia.com.

I can't seem to find the log file at that path. But I don't think that is the issue, I have also tried
sudo add-apt-repository ppa:graphics-drivers
sudo apt-get update
sudo apt install nvidia-346

As well as different versions (nvidia-349, etc). Regardless of what version, it throws this:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package nvidia-346 is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source

E: Package 'nvidia-346' has no installation candidate

I also tried
sudo apt install nvidia-driver-346

When I try lspci -v  it shows that a Xeon E3 and Intel Skylake GT2 graphics, no mention of nvidia.
I'm really stumped, and I would appreciate any input.
output
 $ lspci -k | grep -iEA4 "VGA|3D|Display"

00:02.0 VGA compatible controller: Intel Corporation Skylake GT2 [HD Graphics 520] (rev 07)
Subsystem: ASUSTeK Computer Inc. Skylake GT2 [HD Graphics 520]
Kernel driver in use: i915
Kernel modules: i915
--

You are right. Your NVIDIA isn't recognized.
My solution was run fresh new Ubuntu install and mark " Install Third Party Software".
This way system choose a proper drivers and everything works.
Hope you too, as well.
Here is the easiest solution to be sure, you completely purge NVIDIA, repository, etc. After that, you don't neeed to install any other additional graphics driver. It will be the Intel Graphics.


Half done do-release-upgrade -- now at grub rescue My computer is running single boot Ubuntu 12.04 server version.
I was trying to upgrade the release to 12.10 (following https://help.ubuntu.com/community/QuantalUpgrades)

After executing sudo do-release-upgrade, and agreed to proceed with the download, somehow I lost my video output (hdmi). Nothing was shown to vga output either.

I was able to ssh to my server but was not able to know what was going on with the release upgrade. I just waited long enough till dpkg no longer shows up on top, then I rebooted my server. (yeah, that was a dumb reboot )

Now I'm stuck at

error: file not found
grub rescue>

I can see my disk using

grub rescue> ls (hd0, msdos1)/

These kinds of issues are notoriously hard to fix. Something went wrong with your grub, so what I can think of are three options:

Load in a Ubuntu Live CD and do a grub repair on that partition. One of the best tools for the job is Boot Repair.
Backup data and reformat hard drive.
[Sorta don't advice] Try to manually fix grub.

I would strongly suggest you go with the first one.


xhost setting at boot I am able to set xhost at boot in Fedora by editing /etc/gdm/Init/Default and for example add:

/usr/bin/xhost +local:

How can similar be done in Ubuntu?  I want that the

/usr/bin/xhost +local:

command is executed when the system is sitting at login prompt.

The xhost command needs an active X server to run, it can run at the login screen, for example when lightdm loads.
You can enable it by editing /etc/lightdm/lightdm.conf and adding the line:

display-setup-script=/home/user/bin/xhost.sh

example /etc/lightdm/lightdm.conf file:

[SeatDefaults]
greeter-session=unity-greeter
user-session=ubuntu
display-setup-script=/home/user/bin/xhost.sh

example /home/user/bin/xhost.sh file:

#!/bin/bash
xhost +

It works on Ubuntu 12.04.1 LTS, and it was needed to enable a Java application that needed X and was run by Tomcat 6.

Edit the file /etc/rc.local (with sudo) and add the command before the last command (exit 0).


Who is starting xbindkeys? When I restart my computer, xbindkeys is launched but it doesn't work right. If I kill it and then manually start it with nohup xbindkeys, it works fine. I think it'll work fine if I put it into my .xsessionrc file. But something else is already starting it when I boot, which interferes.

I recursively searched /etc for xbindkeys with no success.

I have found that xbindkeys is automatically started if you have an .xbindkeysrc in your home folder or in a system folder such as /etc. Hence why it does not usually need to be added as a separate startup item once installed.

This is explained well in the file /etc/X11/Xsession.d/98xbindkeys, which is generated by any normal install from the Ubuntu package. Here is a snippet from the file, generated by running cat /etc/X11/Xsession.d/98xbindkeys:

This file is sourced by Xsession(5), not executed.

PROG="/usr/bin/xbindkeys"
NOAUTO="${HOME}/.xbindkeys.noauto"

This file autostarts xbindkeysrc if the user (or system) has a config
for it AND does NOT Have a .xbindkeys.noauto in his homedir.

[The rest of the file is a script]

So, the simple solution is to take note of the instructions and place a file named .xbindkeys.noauto in your home directory, and then xbindkeys won't start up with your x session, and you can place an alternative startup entry for it with your specific needs.

I dealt with this issue by running xbindkeys in terminal on startup!
Add Terminal=true in your .desktop file.


Creating a symlink from one folder to another with different names? I have two folders, one of which is my webserver root. I want to link it to my project folder so that I can keep things up-to-date with Git.

If I try to do this:

ln -s /home/user/project  /var/www/html

The system creates a folder called project within the html folder, and links that. Is there any way to link it so that the directory 'html' points to the contents of project? Do they have to be the same name?

Note: I also need to link several hidden files. Can I do this using ln?

From man ln:

  By default, each destination (name of new link) should not already exist.

As you already have a directory named html, the link will be created inside /var/www/html having the name of the target i.e. project.

If you want to have a symlink /var/www/html pointing to /home/user/project then you should not have the directory html present beforehand. So, you should only have /var/www and then running the following will create the desired symlink (don't do this unless you are sure):

ln -s /home/user/project /var/www/html

Here is an example:

$ pwd
/home/user/test/askubuntu

$ ls -l
total 4
drwxrwxr-x 2 user user 4096 Mar 25 00:16 foo

$ ln -s /home/user/test/bar /home/user/test/askubuntu/foo

$ ls -l
total 4
drwxrwxr-x 2 user user 4096 Mar 25 00:17 foo

$ cd foo/
$ ls -l
total 0
lrwxrwxrwx 1 user user 25 Mar 25 00:17 bar -> /home/user/test/bar

$ cd ..
$ rm -r foo/

$ ls -l
total 0

$ ln -s /home/user/test/bar /home/user/test/askubuntu/foo

$ ls -l
total 0
lrwxrwxrwx 1 user user 25 Mar 25 00:18 foo -> /home/user/test/bar

And yes, you can create symlinks of hidden files.

Make sure html directory is not created under /var/www/.

The command then is: ln -s -T /home/user/project /var/www/html


The cron job doesn't work when put in `/etc/cron.hourly/` but work when defined in `crontab -e` If I define my cron scheduler via crontab -e, the scheduler works correctly. However, putting the file in /etc/cron.hourly/ doesn't work in my case.

Running run-parts --test /etc/cron.hourly output the script. Also, the script name is my_sql_backup and doesn't have a file extension.

The script is root:root with 777 permission.

The cron.hourly scheduler seems to be working as this is the output of grep CRON /var/log/syslog:

Mar  1 11:17:01 my-instance CRON[12919]: (root) CMD (   cd / && run-parts --report /etc/cron.hourly)

Also, if I manually ran the command, the scheduler ran just like it should:

sudo bash -c "cd / && run-parts --report /etc/cron.hourly"

However, this seems to be not working actually. The script is back up MySQL database to Google Cloud Storage, but the storage isn't updated when I check it via Web Console.

Is there anything I'm missing here? Why does my scheduler script that was put in /etc/cron.hourly/ not work?

UPDATE

Having added the echo test > /tmp/foobar.tmp line to my cron script, I found that the tmp file is there. In fact I found my own tmp file issued by the script.

The content of the script is the following. So maybe the problem occured in running gsutil command?

# define environment variables here
sudo sh -c "mysqldump -u$MYSQL_USER -p$MYSQL_PASS $MYSQL_DBNAME --single-transaction | gzip -9 > $MYSQL_TEMPPATH" >/dev/null 2>&1
gsutil cp $MYSQL_TEMPPATH gs://$GS_BUCKET_NAME/$MYSQL_S3_DESTPATH >/dev/null 2>&1

Again, the script worked fine if I manually ran it, so the environment variables are set to correct values...

UPDATE 2

I finally found that after getting the log file issued by gsutil command, it has the following content:

  AccessDeniedException: 403 Insufficient OAuth2 scope to perform this operation.

I still have to investigate why the access is denied if run in /etc/cron.hourly/... But the problem was on gcloud, not cron... Thank you for the support at the comments.

After investigating the log output, I finally found that the log file included the following content which is from the gcloud execution:

  AccessDeniedException: 403 Insufficient OAuth2 scope to perform this operation.

So the problem was on gcloud, not cron.

So how to avoid the access denied error on gcloud?

In order to grant VM access the Cloud Storage, take the following steps:

Stop your VM instance
Edit your VM to change the Cloud Storage from Read to Read/Write.
Restart your VM

And now I finally got it working as scheduled...

The source: https://stackoverflow.com/a/41604071/2360798

You have not provided enough information on the script to understand what it's supposed to do nor why it might fail in a cron job - there are a couple common reasons.

However, your question's title and first paragraph (about user and root crontabs) seems clear enough, so let's answer that:

User crontabs and root crontabs have slightly different formats, and are not interchangeable.

Example:

1 1 * * * root /bin/foo   // root crontab in /etc/cron*
1 1 * * * /bin/foo        // user crontab in /var/spool (see it using the 'crontab' command

See the difference?  A root crontab has an extra field to specify the user. The user need not be root....though in practice it usually is root.

Let's say you want to run a database backup job. Add a root crontab to /etc/cron.d/ that triggers your backup script. Just trigger. One common mistake is to make the crontab more complex than it needs to be. All the logic and error-checking and permissions and logging should be in the script, not the crontab.


Windows 8 failing to install on VirtualBox in ubuntu 12.10 I'm getting the errors attached as screenshots above when I try to start the virtual machine so that it installs windows 8. When the first error popped out, I clicked on continue and it brought the windows 8 logo for 3 minutes then it showed the black screen with the second error. I have also tried it with Physical Address Extension disabled and it brings the Windows 8 Recovery error. The host machine is a 4GB ram Intel Core 2 Duo CPU T6570 @ 2.10GHz × 2 and the Virtual machine has 1GB with 1 CPU. How do i get this virtual win8 machine to work?

you need to enable in the BIOS hardware acceleration config (VT-X or AMD-V, based on your cpu).


/boot/efi can't be mounted after kernel update Ubuntu 13.04 After installing the latest updates it appears that the new version of the kernel which was installed (3.8.0-29) will not boot properly.

Whenever I try to boot using this new kernel, I get an error message indicating that there was an error mounting /boot/efi.

This only happens with this new kernel, as starting up with the older kernel versions works fine.

In case this helps, I have a laptop with UEFI, and I dual boot Ubuntu 13.04 and Windows 8.

Edit:
I tried everything in Rod Smith's answer but I am still having the issue

The exact error message is:

  An error occurred while mounting /boot/efi.

  Press S to skip mounting or M for manual recovery

Pressing S just brings me to a terminal login screen, while pressing M brings me to a recovery terminal.

Here are the the results of the commands you asked me to run:

$ grep efi /etc/fstab
# /boot/efi was on /dev/sda2 during installation
UUID=F433-DF4C  /boot/efi       vfat    defaults        0       1

$ sudo blkid
/dev/sda1: LABEL="WINRE_DRV" UUID="4A46311E46310C67" TYPE="ntfs"
/dev/sda2: LABEL="SYSTEM_DRV" UUID="F433-DF4C" TYPE="vfat"
/dev/sda3: LABEL="LRS_ESP" UUID="5034-7FB2" TYPE="vfat"
/dev/sda5: LABEL="Windows8_OS" UUID="989E38469E381F66" TYPE="ntfs"
/dev/sda6: LABEL="LENOVO" UUID="32EE3B04EE3AC041" TYPE="ntfs"
/dev/sda7: LABEL="PBR_DRV" UUID="14243C89243C703A" TYPE="ntfs"
/dev/sda8: UUID="b5377bd7-1953-4cb0-b30d-9ee5a466760c" TYPE="ext4"
/dev/sda9: UUID="be7e2af0-3cc7-4e3c-82a1-e28e3d4b4ba6" TYPE="swap"
/dev/sdb1: LABEL="CRUZER" UUID="28A2-35DE" TYPE="vfat"

While /dev/sda2 and /dev/sda3 both look similar on my system /dev/sda2 is the one with the "boot" flag, and changing the entry in fstab to the UUID for /dev/sda3 made no difference.

I just updated my Ubuntu 13.04 system to kernel 3.8.0-29 and I had no problem with this. My suspicion is that you're experiencing filesystem damage. This is common on systems that dual-boot with Windows 8 because of a Windows 8 feature called "fast startup." This feature essentially turns the shutdown operation into a suspend-to-disk operation. This works fine on a single-boot computer, but when the computer dual-boots with another OS, the result is dangerous filesystem problems, at least on any filesystem that's shared between OSes (including the EFI System Partition [ESP]). To fix this, boot to Windows and disable fast startup. Note that this feature is not the same as the fast boot option in your firmware; disabling this feature in the firmware does not disable it in Windows 8.

If you disable fast startup and the problem persists, then you could try doing a filesystem check on your ESP, as in dosfsck /dev/sda1. (The device file in Linux might be different, though. Use parted or GParted to find the FAT partition with a "boot flag" set, or use gdisk to find the partition with a type code of EF00.)

If the problem persists even after you disable fast boot and fix the filesystem, please try the following diagnostics:

grep efi /etc/fstab
sudo blkid

Compare the results -- the /etc/fstab file defines where partitions are mounted, and so searching it for efi should produce details on how your system is mounting the ESP. For instance, on my system, it shows the following:

$ grep efi /etc/fstab
# /boot/efi was on /dev/sda1 during installation
UUID=FFB3-46B6  /boot/efi   vfat    defaults    0   1

The blkid command produces information on all your computer's filesystems. You want to compare what it shows for your ESP (usually /dev/sda1, /dev/sda2, or /dev/sda3) to what's in /etc/fstab. For instance:

$ sudo blkid
/dev/sda1: SEC_TYPE="msdos" LABEL="ESP" UUID="FFB3-46B6" TYPE="vfat"
/dev/sda2: LABEL="Fred" UUID="421258c1-e9b1-4b1b-9dd7-60b82e75f8c3" TYPE="ext4"
/dev/sda3: UUID="9108d33b-855d-49ba-8b9e-90f981a597ea" TYPE="swap"

In this case, /dev/sda1 is the ESP -- it's a FAT (TYPE="vfat") filesystem, and its serial number matches what's in /etc/fstab (UUID="FFB3-46B6"), so all is in order. A mismatch of the serial numbers or some other detail might cause the problem you're encountering. If you need more help, please edit your post with this information and the exact error message you're seeing.

I've just had a similar problem when using boot-repair to move to UEFI. Sounds silly, but I just put double quotes around the UUID value, did sudo mount -a (or reboot)  and the error went away.
So I would change your /etc/fstab entry from

UUID=F433-DF4C  /boot/efi       vfat    defaults        0       1

to

UUID="F433-DF4C"  /boot/efi       vfat    defaults        0       1


How to package from source? I would like to package Nagios 4 on Ubuntu. Installation from source involves multiple make commands and a configure command.

wget -O nagioscore.tar.gz https://github.com/NagiosEnterprises/nagioscore/archive/nagios-4.3.4.tar.gz
tar xzf nagioscore.tar.gz
cd /tmp/nagioscore-nagios-4.3.4/
./configure --with-httpd-conf=/etc/apache2/sites-enabled
make all
make install
make install-init
make install-commandmode
make install-config
make install-webconf

How do I make a deb or apt package out of this?

I tried following the Ubuntu instructions
http://packaging.ubuntu.com/html/packaging-new-software.html
When I run the bzr dh-make package version package.tar.gz, I get the following error

bzr: ERROR: Either run the command from an existing branch of upstream, or move nagioscore-nagios-4.3.4 aside and a new branch will be created there.

From https://help.ubuntu.com/community/CompilingEasyHowTo:

  If you got this far, you've done the hardest part already. Now all you
  need to do is run the command

make which does the actual building (compiling) of the program.

  If it's a large program or if you've got a very slow computer, go and
  get a cup of coffee or something. If you have a multi-core processor
  you can also set the variable CONCURRENCY_LEVEL to the number of
  processors/cores you have to speed things up a little.

  When it's done, install the program. You probably want to use sudo checkinstall which puts the program in the package manager for clean, easy removal later. This replaces the old sudo make install
  command.


Kill terminal process? I am trying to install ruby virtual machine by running commands from terminal.While installing rails some error occurs and terminal got stuck up.What should be the action in the specified case.I tried ctrl+esc, esc, ../ etc like command prompt from windows.But it doesn't work.What is the proper way to end the process without closing the terminal?

Try these keyboard shortcuts

Ctrl + C

or

Ctrl + Break

use ps or top to fınd out PID(proces ıd) and use kill -9 PID


How to stop postgres from autostarting during start up I have postgresql 8.4 installed on my desktop. It keeps starting on bootup because I think I used default settings.

so I issue /etc/init.d/postgresql stop everytime and sometimes i keep forgetting

It has folder paths as,

/etc/postgresql/8.4/main
/usr/lib/postgresql/8.4

There are a lot of configuration files and if someone can tell me where to look and what to change, that will be great.

Thanks.

On Ubuntu 16.04 or later (which use systemd) you'd use this command

sudo systemctl disable postgresql

If you want to re-enable, you'd do

sudo systemctl enable postgresql

On Ubuntu 15.10 and older, you can use update-rc.d:

janus@Zeus:~$ sudo update-rc.d -f postgresql remove
 Removing any system startup links for /etc/init.d/postgresql ...
   /etc/rc0.d/K21postgresql
   /etc/rc1.d/K21postgresql
   /etc/rc2.d/S19postgresql
   /etc/rc3.d/S19postgresql
   /etc/rc4.d/S19postgresql
   /etc/rc5.d/S19postgresql
   /etc/rc6.d/K21postgresql
janus@Zeus:~$

On my server there is another effect:

# update-rc.d -f postgresql remove
update-rc.d: using dependency based boot sequencing

No system startup links were removed.


Razer Kraken 7.1 calibration I am planning on buying a headset for my pc and its either going to be the Razer Kraken Pro or the Razer Kraken 7.1. The thing is that the 7.1 is a usb headset has some software for mic calibrations and sound quality which cannot be run under linux. My question is this, is there similar software in linux to calibrate the 7.1 headset or should I go for the analog Kraken Pro? Thanks in advance!

From what I've seen, it's my understanding that the difference between 7.1 and stereo is made in your sound card, and that any stereo headset can be made into a virtual 7.1 headset by changing some sound options under All Settings > Sound > Output **
change the **Mode to Analog Surround 7.1 Output

However, a USB headset is preferred as it comes with its own built-in sound card (especially if your computer's sound card doesn't support anything higher than stereo).
I bought the 7.1 pro & haven't looked back. It's great.

Bottom line is, both the Kraken Pro and the Kraken 7.1 get their 7.1 audio from your sound card, and so both will have the same 7.1 audio. The Kraken 7.1 just gets more customization with the Razer software, and whatever differences there are in the specs. I don't think that Ubuntu has any of the fine-tuning that Razer's software has, but both headsets should have 7.1 surround once you set them to be that way.

Before you go off and buy one of these, take note that I'm not 100% sure that this is correct - this information is just from what I've seen whilst browsing for a new headset and personal experience with the audio options for my current pair of headphones. It'd be a good idea to go find some other sources, or wait for someone more knowledgeable to answer this question.

I hope you understand the fact that you don't need 7.1 to experience full 3D surround sound. After all, we, humans have only two sound inputs (called ears) and there is no place to put more speakers around our head than that number.

The way human brain senses direction of the sound is more complex than disparity in sound levels between the ears. Human brain also process the phase difference between the sound sources. The sound coming from the left comes a little faster to the left ear, than to the right. The difference might seem at first glance tiny, but it is in fact quite big. The 1kHz sound produces 180° phase shift in a distance of  full phase


Hard drive clicking noise on Acer AO722 I'm running Ubuntu 11.10 on an Acer Aspire One 722. Whenever I'm on battery power I get a clicking sound from my hard drive every 5 seconds or so (this does not happen when the laptop is plugged in). I'm dual booting with Windows 7 and I don't get the clicking sound in Windows.

The clicking sound stops when I run the command:sudo hdparm -B 254 /dev/sda

Also, according to:sudo smartctl -H /dev/sda my hard drive is healthy.

Is this clicking sound something I can just ignore? Or is it a serious problem and will it eventually damage my computer? If so, how would I fix it?

I have tried adding hdparm -B 254 /dev/sda to my /etc/rc.local file, but I still run into the clicking problem if my computer boots while plugged in and is then unplugged. Also, I'm finding this fix to be unreliable. Sometimes it works, sometimes it does not. Is this a good solution and is there a better way of doing this? Also, would running my laptop with a -B value of 254 have any negative effects? (I read somewhere about a lower level protecting the hard drive from bumps)

gksudo gedit /etc/hdparm.conf

Enter and on the "bottom" of the gedit file

 /dev/sda {
    apm = 254
    apm_battery = 254
}

sudo hdparm -B 254 /dev/sda

in the terminal.

reduce swappiness:
gksudo gedit /etc/sysctl.conf

beneath the config file

vm.swappiness=10

reboot your machine

control:
cat /proc/sys/vm/swappiness


How to fix virtualbox's copy and paste to host-machine? Sometimes while using VirtualBox, I have tried copying text from the virtual machine to the host machine but failed. Whenever that happens, I fix it by rebooting the virtual machine.  Is there a solution to this because I don't want to keep rebooting again and again.

Note: It is always possible for me to copy text from the host to the virtual machine.

If your guest OS is ubuntu then running following two commands in ubuntu terminal should help:

$ killall VBoxClient
$ VBoxClient-all

My configuration is Windows host, Xubuntu guest.  I guess it doesn't hurt to restart everything, but this is the client that matters.  (VBoxClient-all is merely a script that runs /usr/bin/VBoxClient --clipboard and others.)

$ ps -fe|grep -i clip
tbc       1400     1  0 Jan18 ?        00:00:00 /usr/bin/VBoxClient --clipboard
$
$ p=1400;kill -int $p;ps -fp $p
$ /usr/bin/VBoxClient --clipboard
$ ps -fe|grep -i clip
tbc      30555  1281  0 13:01 ?        00:00:00 /usr/bin/VBoxClient --clipboard
$ pstree -sp 30555
init(1)---lightdm(1094)---lightdm(1261)---init(1281)---VBoxClient(30555)---{VBoxClient}(30556)
$

Note it runs in the background by default. It was owned by init(1), but when I invoked it, it got adopted through a tree I'm not familiar with.