Add the following line within your <VirtualHost></VirtualHost> directive: php_value memory_limit 128M For increasing the allowed memory to 128 MB for php to consume for the specific virtual host.
Category: Software
compile C and C++ code into one binary in Linux
Sometimes you have a project written in C and you want to add some code (may be open source software) which is provided in C++. So you may want to call a function written in C++ from C. For that purpose, you have to change the function prototype of the concerned C++ function like: #ifdef… Continue reading compile C and C++ code into one binary in Linux
change max_allowed_packet (or any arbitrary DB parameter group value) in Amazon RDS from commandline
This task sounds to be quite easy, but because the AWS Management Console does not allow the manipulation of parameter group values, you have to go the way using the API from your commandline (or from wherever you want). This post will explain how to do it in your console using the API tools from… Continue reading change max_allowed_packet (or any arbitrary DB parameter group value) in Amazon RDS from commandline
start Matlab using just one computation thread for computation
For reference it might be useful running Matlab computations only on one core: matlab -singleCompThread
Create MATLAB readable avi from bmp frames
Use the following command ffmpeg -vframes 200 -f image2 -i airport1%03d.bmp -f avi -vcodec rawvideo -pix_fmt bgr24 -acodec pcm_s16le airport.avi This will convert all the files airport1000.bmp to airport1200.bmp to an avi file. Using mencoder will allow you to chose the framerate: mencoder “mf://*.bmp” -mf fps=12 -o out.avi -ovc lavc -lavcopts vcodec=msmpeg4v2:vbitrate=800
make terminal case insensitive (debian linux)
Open / create the inputrc file by typing pico ~/.inputrc And add the line: set completion-ignore-case on
switch off cpu cores in ubuntu/linux
For some benchmarks it can be important to have a system operating on just a specific number of CPU cores. To find out how many you have, just count them by: $ ls -l /sys/devices/system/cpu/ Switching a core off is just as easy as echo 0 > /sys/devices/system/cpu/cpu7/online which would switch off core 7. For… Continue reading switch off cpu cores in ubuntu/linux
tab exension for hostnames in ssh
Using the tab extension is a nice thing. To make ssh know your hosts, add three lines in the ~/.ssh/config folder: Host mySpecialHost HostKeyAlias somehost-somewhere.ch Hostname somehost-somewhere.ch
access (lot of small) functions residing in one MATLAB m file
Usually, you create one m-file for one MATLAB function. But what to do if you have many small functions? It’s odd to create a lot of files which just contain some lines of code. The other approach is to put the small functions just inside the m file where they are called from. This is… Continue reading access (lot of small) functions residing in one MATLAB m file
send big chunk of data over linux sockets
Sending a big chunk of data over linux sockets can be tricky, because we need to call the write function multiple times. The following snippet assumes a valid socket filedescriptor “socketfd”, after the connection is established. Make sure that PACKETSIZE is smaller or equal to 2^16 and that nbytes equals the amount of bytes of… Continue reading send big chunk of data over linux sockets