Resize large images in php with imagemagick

Resizing images Web applications often need to work with images like pictures of users or photos etc. So the need to need to resize images comes up when creating thumbnails for example or compressing images for storage. The default library to handle image operations in php is GD. It can be used to resize images. Resize with GD The function imagecopyresampled is used ...

Ubuntu – automatically mount partition at startup with fstab

Auto mount partitions On linux the hard drive partitions are generally not mounted at boot. Clicking on the drive icon inside a file manager like nautilus or dolphin mounts them first and then shows the files. But it is possible to get the drives mounted right at boot. The configuration file in this case is /etc/fstab. It contains options for each drive ...

Create ISO from CD DVD on Ubuntu

To create an iso from a cd/dvd. 1. Put the disc into the drive. 2. Use the command cat /dev/cdrom > ~/disc.iso Or use K3B to create iso , or the command mkisofs ...

htaccess php_flag not allowed here

If using this code <IfModule mod_php5.c> #Turn off php register globals php_flag register_globals off </IfModule> gives the error : .htaccess: php_flag not allowed here in /var/log/apache/error.log Then Options should be added to AllowOverride in : /etc/apache2/sites-available/default AllowOverride FileInfo Options like this <Directory /var/www/> Options Indexes FollowSymLinks MultiViews ...

PHP Urlencode equivalent in Ruby

If you are finding a way to encode urls in ruby then here is a quick tip - Short Answer: You could use the URI class or the CGI class. We have CGI.escape and URI.escape, but they have some slight differences. I have tried to show the differences in IRB as follows - $ irb irb(main):001:0> str = 'hello world' => "hello world" irb(main):002:0> require 'uri' => ...

Find where a method is defined in Ruby

There are times when you might be working on a codebase with other people and spot a method which you do not know about. You may want to locate the source of that method to learn and understand more about its functionality. So, Here is a quick tip on how to find where a method is defined or located. I was working ...

Install Ruby 1.9.2 on Ubuntu

As you all know Ruby is one of the most popular programming language on the web. It is recommended to install ruby 1.9.2 instead of 1.8.x I tried to install ruby from the package manager on Ubuntu, but ruby 1.9.2 is not there in the repo. So, I am going to show you how to install ruby 1.9.2 on Ubuntu Step 1 - Fire ...

Check system load in php on linux

System load System load is a measure of how busy the system is running the processes. Higher system load simply means more processes are running and more are waiting to be run. When coding php applications, it sometimes is useful or necessary to find the current load on the server/system. For example if you want to run a long resource intensive ...

Increase phpmyadmin session/login time in Ubuntu 9.10 Karmic

Phpmyadmin Login time To increase the loging time of phpmyadmin edit : /etc/phpmyadmin/config.inc.php Add the following line : $cfg = 3600 * 9; To make the login time 9 hours. Along with this also check session.gc_maxlifetime in php.in to be higher than or equal to this value. Otherwise session time will be the lower of the two values. ...

Url encoded forward slash in MVC or codeignitor app urls

When using PATH_INFO , the urls of codeignitor apps or your custom MVC looks like this index.php/controlller/method/param1/param2 or /controlller/method/param1/param2 Now if the parameters contain a forward slash then you would urlencode it as : index.php/controlller/method/par%2Fam1/param2 But opening that kind of URL would give an error : Page Not Found This happens if AllowEncodedSlashes directive of Apache is not turned on. More Here. This directive should be turned ...



Connect with us