Installing pear beta packages

You are trying to install a new pear package but get an error because pear is configured as stable and the package is beta ?

pear install Spreadsheet_Excel_Writer
Failed to download pear/Spreadsheet_Excel_Writer within preferred state "stable", latest release is version 0.9.3, stability "beta", use "channel://pear.php.net/Spreadsheet_Excel_Writer-0.9.3" to install
install failed

Here some tips to help you :
– force installation with -f

pear install -f Spreadsheet_Excel_Writer-0.9.3

– change pear preferences

pear config-set preferred_state beta
pear install Spreadsheet_Excel_Writer-0.9.3
pear config-set preferred_state stable

or do it directly within the same command

pear -d preferred_state=beta install Spreadsheet_Excel_Writer-0.9.3

– add the shorcut -beta at the end of the package name

pear install Spreadsheet_Excel_Writer-0.9.3-beta

SSH scp error no hostkey alg

ssh works well but when you try to copy a file via scp you get this error

no hostkey alg

Go on your server and check if you have /etc/ssh/ssh_host_rsa_key and /etc/ssh/ssh_host_dsa_key files, if not, generate them

ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key
ssh-keygen -t dsa -f /etc/ssh/ssh_host_dsa_key

SSH Read from socket failed: Connection reset by peer

After installing a container with lxc I wasn’t able to connect via ssh to my container, I get the following message :

root@ns313:~# ssh 10.50.10.10
Read from socket failed: Connection reset by peer

Network works normally, I can ping, hotst both direction and I can get pages from apache’s container from the dom0.

I tried to connect to ssh from container, in local and I get the same error.

root@container:/etc/ssh#ssh 10.50.10.10 -l root
Read from socket failed: Connection reset by peer

Strange, first time ssh doesn’t work on any machine.
Try restart sshd

root@container:/etc/ssh# /etc/init.d/ssh restart
Could not load host key: /etc/ssh/ssh_host_rsa_key
Could not load host key: /etc/ssh/ssh_host_dsa_key
Could not load host key: /etc/ssh/ssh_host_ecdsa_key
[....] Restarting OpenBSD Secure Shell server: sshdCould not load host key: /etc/ssh/ssh_host_rsa_key
Could not load host key: /etc/ssh/ssh_host_dsa_key
Could not load host key: /etc/ssh/ssh_host_ecdsa_key
. ok 

SSH keys are missing, to fix it, run this command :

root@container:/etc/ssh# ssh-keygen -t ecdsa -f /etc/ssh/ssh_host_ecdsa_key -N ''

SSH How to connect without password

A classic hack for linux users, connect via ssh without password.

First, on your client, generate public key

ssh-key-gen -t rsa

keep ~/.ssh/id_rsa by default.

Copy public key (~/.ssh/id_rsa.pub) from your client to the file ~/.ssh/authorized_keys2 on the server with the ssh-copy-id binary.

Then edit your ~/.ssh/config file on client side to custom your params:

Host dev
  HostName dev.domain.com
  Port 22
  User root

Finaly, you can add an alias in your ~/.bashrc

alias dev='ssh dev'

Now, to launche a ssh connection, just run

dev