Installing psycopg2 into virtualenv

When you run pip install psycopg2 from within your virtualenv you will receive following error:


$ pip install psycopg2
Downloading/unpacking psycopg2
Running setup.py egg_info for package psycopg2

Error: pg_config executable not found.

Please add the directory containing pg_config to the PATH
or specify the full executable path with the option:

python setup.py build_ext --pg-config /path/to/pg_config build ...

or with the pg_config option in 'setup.cfg'.
Complete output from command python setup.py egg_info:
running egg_info

writing pip-egg-info/psycopg2.egg-info/PKG-INFO
writing top-level names to pip-egg-info/psycopg2.egg-info/top_level.txt
writing dependency_links to pip-egg-info/psycopg2.egg-info/dependency_links.txt
warning: manifest_maker: standard file '-c' not found

Error: pg_config executable not found.

Please add the directory containing pg_config to the PATH
or specify the full executable path with the option:

python setup.py build_ext --pg-config /path/to/pg_config build ...

or with the pg_config option in 'setup.cfg'.

----------------------------------------
Command python setup.py egg_info failed with error code 1

To solve this, just install apt-get install libpq-dev.

ffmpeg_ffmpeg-php_hosting

Encoder (codec none) not found for output stream #0:1

ffmpeg is a great tool to convert videos and to create snapshots from a video. But on every project Im facing the same problem: missing codecs. Here is the solution for this problem:

$ sudo add-apt-repository ppa:jon-severinsson/ffmpeg
$ sudo apt-get update
$ sudo apt-get install ffmpeg
$ sudo apt-get install libavcodec-extra-53

The extra-xx version can change and depends on your current linux distro release.

Android captured almost 70% global smartphone market share in 2012, Apple just under 20%

Its nice to see that android is dominating the smartphone market, but mobile apps vendors are still receiving more iPhone projects. Seems that apple is still well known.

Mega-Encryption

The article describes the two used encryption – AES for user storage and RSA for collaboration file sharing. -  ”On the other hand, even if the service doesn’t know those blocks of data happen to be The Hobbit, the service does know which users own those deduplicated blocks, and if one user is implicated, there’s proof against all the others, too.”

Mega Vs Dropbox Vs Boxnet: Features Compared

nice comparison between the cloud online storage services. It would be great to add Google Drive and Skydrive … Mega blows away the competition due to its cost/per GB being the lowest.

Tuning the network

Tuning the network

Your system imposes a variety of thresholds and limits on TCP traffic, dictated by its kernel parameter configuration. The default settings are designed for accommodating generic networking use. They are not necessarily geared up for high-volumes of short-lived connections handled by a web server. These settings are important for a realtime enviroment:

net.ipv4.ip_local_port_range='1024 65000'
net.ipv4.tcp_tw_reuse='1'
net.ipv4.tcp_fin_timeout='15'
net.core.netdev_max_backlog='4096'
net.core.rmem_max='16777216'
net.core.somaxconn='4096'
net.core.wmem_max='16777216'
net.ipv4.tcp_max_syn_backlog='20480'
net.ipv4.tcp_max_tw_buckets='400000'
net.ipv4.tcp_no_metrics_save='1'
net.ipv4.tcp_rmem='4096 87380 16777216'
net.ipv4.tcp_syn_retries='2'
net.ipv4.tcp_synack_retries='2'
net.ipv4.tcp_wmem='4096 65536 16777216'
vm.min_free_kbytes='65536'

Stanford Javascript Crypto Library

MEGA is using a mix of flash and the stanford javascript crypto library to encrypt the uploaded documents using HTML5 File Api.

Javascript Cryptography Considered Harmful

MEGA is a great example on how to encrypt data between browser and the server. Is Javascript the right technology in concern of security ?

mega

Kimble has launched his new project mega

250,000 user registrations. Server capacity on maximum load :( Let me in … After registering you will receive 50 GB of free space. Thats really huge … Im really curious how the Mega Team has implemented the Browser File Upload encryption everybody talks … I suppose it could be done in Javascript. I would hope they are at least not using Java or Flash.

ImportError: cannot import name “urandom”

If you ever get this kind of error you can be sure that this has something to do with your virtualenv. This is due to the fact that a virtualenv uses the system Python’s standard library but contains its own copy of the Python interpreter, so an upgrade to the system Python results in a mismatch between the version of the Python interpreter and the version of the standard library. To fix that just reinit your virtualenv, e.g. you have some problems with your “foo” virtualenv directory:

# mv /opt/foo /opt/foo2
# /opt/virtualenv foo
# cp -r /opt/foo/bin/* /opt/foo2/bin/.
# mv /opt/foo /opt/foo_deprecated
# mv /opt/foo2 /opt/foo