Archive

Archive for March, 2013

libmysql-dev missing on a webhoster when trying to install mysql-python

March 21st, 2013 1 comment

can be a pain in the arse . . .
As I had to do this a couple of times lately, here is a annotated snippet of my bash history. This is mainly a “note to self”:

#install virtenv
curl -O https://pypi.python.org/packages/source/v/virtualenv/virtualenv-1.9.1.tar.gz
tar xvfz virtualenv-1.9.1.tar.gz
mkdir src app bak
mv virtualenv-1.9.1.tar.gz bak/
mv virtualenv-1.9.1 src/
python src/virtualenv-1.9.1/virtualenv.py app/
. ./app/bin/activate
# try to install - it will fail with missing libmysqlclient headers and stuff
pip install mysql-python
uname -a
cd src/
# get the package we cannot install (no root/sudo) 
wget http://security.debian.org/debian-security/pool/updates/main/m/mysql-5.1/libmysqlclient-dev_5.1.66-0+squeeze1_amd64.deb
ar x libmysqlclient-dev_5.1.66-0+squeeze1_amd64.deb
mkdir libmysqlclient-dev
mv control.tar.gz libmysqlclient-dev/
mv data.tar.gz libmysqlclient-dev/
mv libmysqlclient-dev_5.1.66-0+squeeze1_amd64.deb libmysqlclient-dev/
cd libmysqlclient-dev/
tar -xzf data.tar.gz
cd usr/
cd bin/
cp mysql_config /home/william/app/bin/
cd ..
cd include/
cp -a mysql /home/william/app/include/
cd ..
cd lib/
cp -a * /home/william/app/lib/
cd ..
cp -a share /home/william/app/
cd ~
vim .bashrc
#[logout and in to activate bashrc changes]
. ./app/bin/activate
#try again - it will report the missing libs that cat be found in /usr/lib
pip install mysql-python
cd app/lib/mysql/
cp /usr/lib/libmysqlclient* ./
cd ~
# try a third and hopefully last time
pip install mysql-python

Willi

Categories: linux Tags:

ssh keys and encrypted home directory

March 21st, 2013 4 comments

If home is encrypted, sshd cannot access your authorized_keys file. Therefore key based auth only works after loging in via passwort to unlock home. Solution is to change the location where sshd looks for the keys to a folder outside encrypted home:

mkdir /etc/ssh/william
chown william:william /etc/ssh/william
mv /home/william/.ssh/authorized_keys /etc/ssh/william/
vim /etc/ssh/sshd_config 
AuthorizedKeysFile /etc/ssh/%u/authorized_keys
service ssh restart

This solution is also described here: https://help.ubuntu.com/community/SSH/OpenSSH/Keys#Troubleshooting

Cheers,
Willi

Categories: linux, software Tags:

clang++ vs. g++ 1:0

March 5th, 2013 2 comments

Oder wieso man wirklich clang(++) benutzen sollte, wenn es drauf ankommt. Was sagt Euch diese g++ Fehlermeldung?

In file included from ../include/build.h:6,
                 from lexyacc.h:4,
                 from chapel.ypp:18:
../include/stmt.h:108: error: multiple types in one declaration

Es sei dazu gesagt, dass auf Zeile 108 irgendwelcher Code steht, den ich nicht angefasst habe. Aussage gleich null. Schauen wir was clang++ daraus macht:

In file included from ../include/build.h:6:
../include/stmt.h:92:2: error: expected ';' after class
}
 ^
 ;
1 error generated.

UND WIESO IHR GNU SPASSEMACKEN KÖNNT IHR MIR DAS NICHT SAGEN? Mann du … 30min Zeit verschwendet weil man aus versehen ein Semikolon gelöscht hat und der Compiler zu dämlich ist vernünftige Fehlermeldungen zu werfen. Kann mir irgendwer erklären wieso dieser g++ und gcc Dreck so dermaßen dämlich ist, gibt es da irgendeinen triftigen technischen Grund für?

Categories: c/c++, nerdcore Tags: , , ,