Getting mime in php

We have been using php fileinfo for a while and were not happy about how office 2007 files were identified as .zip as mime type. Which is actually accurate they are zip archives. When serving those files back to users we had some users complain about file being identified as corrupt. If you can compile […]

Read More

Expand filesystem of linux vm

So we have a test server running ubuntu 12.04. We realized we will be needing more space on this server for testing different versions of our application. First I have allocated more disk space from VM properties of virtual machine. Increased size under Disk provisioning section. root@dagobah:~# fdisk -l /dev/sda   Disk /dev/sda: 42.9 GB, […]

Read More

Scp examples

Copy the file “foobar.txt” from a remote host to the local host $ scp username@remotehost.edu:foobar.txt /path/to/directory Copy the file “foobar.txt” from the local host to a remote host $ scp foobar.txt username@remotehost.edu:/path/to/directory Copy the file “foobar.txt” from remote host “server1” to remote host “server2” $ scp username@server1:/some/remote/directory/foobar.txt \ username@server2:/some/remote/directory/

Read More

MaxRequestsPerChild Directive in Apache 2.2

One of our servers run on apache which has mpm_winnt_module enabled. I was seeing memory consumption going up by time. Recently I checked httpd.conf to see it had directives configured correctly and discovered MaxRequestsPerChild 0MaxRequestsPerChild 0 Again based on Apache documentation setting MaxRequestsPerChild to a non-zero value limits the amount of memory that process can […]

Read More

Sql IN clause 1000 item limit

We have some queries on our web application that required us to write sql statements which includes IN clause for thousands of items. We hit Oracle limit for 1000 items on those IN clauses. We resolved this by separating them with OR based on queries. Recently I learned that, Any in statement like X IN  […]

Read More