Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Hot answers tagged

133

.bash_profile and .bashrc are specific to bash, whereas .profile is read by many shells in the absence of their own shell-specific config files. (.profile was used by the original Bourne shell.) .bash_profile or .profile is read by login shells, along with .bashrc; subshells read only .bashrc. (Between job control and modern windowing systems, .bashrc by ...


133

Apparently, the current method to auto-start Docker containers (from Docker 1.2) is to use restart policies. This will control how Docker should handle starting of the container upon startup and re-starting of the container when it exits. I've used the 'always' option so far, and can confirm that it makes Docker auto-start the container at system boot: sudo ...


112

I usually do release upgrades over VPN, so I've tried this a few times. Whenever it updates my openvpn package I lose connection, so I reconnect afterwards. do-release-upgrade starts a backup SSH session on port 1022 and a backup screen session. If you do not have screen installed this will NOT be available. You can get the screen session by running: sudo ...


108

http://comments.gmane.org/gmane.comp.encryption.openssl.user/43587 suggests this one-liner: openssl crl2pkcs7 -nocrl -certfile CHAINED.pem | openssl pkcs7 -print_certs -text -noout It indeed worked for me, but I don't understand the details so can't say if there are any caveats.


103

You can use Docker for Windows as the engine and Docker for Linux as the client in Bash on Ubuntu on Windows. Connect them via TCP. Install Docker for Windows: https://hub.docker.com/editions/community/docker-ce-desktop-windows If you want to use Windows Containers instead of Linux Containers both type containers can be managed by the Linux docker client in ...


95

It's possible that a process has opened a large file which has since been deleted. You'll have to kill that process to free up the space. You may be able to identify the process by using lsof. On Linux deleted yet open files are known to lsof and marked as (deleted) in lsof's output. You can check this with sudo lsof +L1


94

Installing PHP 5.4.* on Ubuntu 12.04 Simply add the PPA repository: sudo add-apt-repository ppa:ondrej/php5-oldstable And install it: sudo apt-get update sudo apt-get install php5 You may need to install add-apt-repository on Ubuntu 12.04. To do so, run the command: sudo apt-get install python-software-properties Other New Versions For PHP 5.5 (...


94

For our ec2 ubuntu instance, the above answers did not work completely. On Ubuntu, by default, the check is not enabled in the rcS file. So Edit rcS file sudo vi /etc/default/rcS below the line #FSCKFIX=no Add FSCKFIX=yes Edit fstab file. sudo vi /etc/fstab Look for the the record for / and if the last digit is '0' change it to '1'. The last field ...


91

$ rpcinfo -p | grep nfs Port 111 (TCP and UDP) and 2049 (TCP and UDP) for the NFS server. There are also ports for Cluster and client status (Port 1110 TCP for the former, and 1110 UDP for the latter) as well as a port for the NFS lock manager (Port 4045 TCP and UDP). Only you can determine which ports you need to allow depending on which services are ...


89

It turns out my key was not in the agent, and this fixed it: OS X: ssh-add -K Linux/Unix: ssh-add -k You can list loaded keys using: ssh-add -l


86

I got the error message to go away by putting the following in my provisioning script, prior to any apt-get calls: export DEBIAN_FRONTEND=noninteractive This makes debconf use a frontend that expects no interactive input at all, preventing it from even trying to access stdin.


83

You need to edit two files: /etc/motd (Message of the Day) /etc/ssh/sshd_config: Change the setting PrintLastLog to "no", this will disable the "Last login" message. And then restart your sshd.


83

The sites-* folders are managed by nginx_ensite and nginx_dissite. For Apache httpd users who find this with a search, the equivalents is a2ensite/a2dissite. The sites-available folder is for storing all of your vhost configurations, whether or not they're currently enabled. The sites-enabled folder contains symlinks to files in the sites-available folder. ...


81

Source your envvars by running it like this: source /etc/apache2/envvars and then /usr/sbin/apache2 -V You should get: el@apollo:/home/el$ apache2 -V Server version: Apache/2.4.7 (Ubuntu) Server built: Apr 3 2014 12:20:28 Server's Module Magic Number: 20120211:27 Server loaded: APR 1.5.1-dev, APR-UTIL 1.5.3 Compiled using: APR 1.5.1-dev, APR-UTIL 1....


81

To block 116.10.191.* addresses: $ sudo iptables -A INPUT -s 116.10.191.0/24 -j DROP To block 116.10.*.* addresses: $ sudo iptables -A INPUT -s 116.10.0.0/16 -j DROP To block 116.*.*.* addresses: $ sudo iptables -A INPUT -s 116.0.0.0/8 -j DROP But be careful what you block using this method. You don't want to prevent legitmate traffic from reaching the ...


76

You can use: > /var/log/mail.log That will truncate the log without you having to edit the file. It's also a reliable way of getting the space back. Sometime people make the mistake of using rm on the log then recreating the filename, if another process has the file open then you don't get the space back until that process closes it's handle on it and ...


73

You are right, the Ubuntu EC2 EBS images don't come with swap space configured (for 11.04 at least). The "regular" instance-type images do have a swap partition, albeit only 896 MB on the one I tested. If some process blows up and you don't have swap space, your server could come to a crawling halt for a good while before the OOM killer kicks in, whereas ...


73

I had the same problem. All you have to do is add --allow-root to your command. See this issue.


71

You almost certainly have set the wrong character set in your PuTTY settings. Verify the character set on the remote system by running the command: locale This should return something like: LANG=de_DE.UTF-8 LC_CTYPE="de_DE.UTF-8" LC_NUMERIC="de_DE.UTF-8" LC_TIME="de_DE.UTF-8" LC_COLLATE="de_DE.UTF-8" LC_MONETARY="de_DE.UTF-8" LC_MESSAGES="de_DE.UTF-8" ...


70

Do it from your command line: php -v mysql -V and: php -i | grep -i '^libxml' OR Put this in your root directory: <?php phpinfo(); php?> Save it as phpinfo.php and point your browser to it (this could be http://localhost/phpinfo.php)


70

In Linux and other *nixes, MySQL will assume you want to use a socket if you connect to the host "localhost" (which would be the default hostname). You can override this in 3 ways: 1) Specify a different hostname like 127.0.0.1 (mysql -h 127.0.0.1) or your server's real hostname 2) Specify that you want to use TCP and not a socket (mysql --protocol tcp) ...


68

First stop your server obviously: sudo service apache2 stop Remove apache2 packages and dependencies: sudo apt-get purge apache2 apache2-utils apache2.2-bin apache2-common sudo apt-get autoremove --purge If you manually modified or installed stuff, apt might not remove it. Check what's left: whereis apache2 Have a look whats inside these directories, ...


67

Based on the date displayed by your version of OpenSSL, it seems you are seeing the full version displayed there. Open SSL 1.0.1 was released on March 14th, 2012. 1.0.1a was released on April 19th of 2012. So, I'm going to go ahead and assert that openssl version -a is the proper, cross-distro way to display the full version of OpenSSL that's installed on ...


61

Simple: grep ^Package: /var/lib/apt/lists/ppa.launchpad.net_*_Packages Or more flexible: grep-dctrl -sPackage . /var/lib/apt/lists/ppa.launchpad.net_*_Packages For fancier querying, use apt-cache policy and aptitude as described here: aptitude search '~O LP-PPA-gstreamer-developers'


61

With 'su' is probably that request a password, and www-data doesn't have password. I recommend the command sudo: sudo -u www-data command The condition is that your user must be root, or configurated in the sudoers file


60

Change your authorization configuration: <Directory /home/remix/> #... Order allow,deny Allow from all </Directory> ...to the Apache 2.4 version of the same. <Directory /home/remix/> #... Require all granted </Directory> Review the upgrading overview document for information on other changes you might need to ...


60

Woo, I found a post on github that solved my problem. After Steve K. pointed out that it wasn't actually a DNS issue and was a connectivity issue, I was able to find a post on github that described how to fix this problem. Apparently the docker0 network bridge was hung up. Installing bridge-utils and running the following got my Docker in working order: ...


59

My problem is not the same as can't type lower cased e in amazon ec2 (Amazon Linux), but similar. After checking /etc/inputrc and finding nothing out of the ordinary, I remembered that I did do some keybinding in the /etc/bash.bashrc. This was already there for a very long time and worked flawlessly, though. Why would it make problems now? I found out ...


58

One of your login scripts (.bashrc/.cshrc/etc.) is probably outputting data to the terminal (when it shouldn't be). This is causing ssh to error when it is connecting and getting ready to copy as it starts receiving extra data it doesn't expect. Remove output that is generated in the startup scripts. You can check if your terminal is interactive and only ...


57

[Fri Nov 29 17:35:43.942472 2013] [core:warn] [pid 14655] AH00111: Config variable ${APACHE_LOCK_DIR} is not defined This message is displayed because you directly executed the apache2 binary. In Ubuntu/Debian the apache config relies on the envvar file which is only activated. If you start apache with the init script or apachectl. Your original problem ...


Only top voted, non community-wiki answers of a minimum length are eligible