Browsing the archives for the scripting tag

Cloud Sites Timeout on CMS Install

Load balancers usually have a limit on how long a TCP connection will remain open to a web server before timing out on the connection. With Cloud Sites in particular, the load balancer will time out on an HTTP response if the PHP code does not send output to the browser for 30 seconds. After […]

No Comments Posted in Uncategorized
Tagged , , , , , ,
Unzipping files through php

The following script will unzip all files within the current directory and then print its results to the browser. To unzip a file, upload your .zip files and then upload this php file to the same directory and then visit this page in your browser. You could for example save this file as unzip.php and […]

No Comments Posted in php
Tagged , , ,
Sorting files by datestamp in Bash

You would think there were a function in Linux already that would do this.  The following command will sort all files in a directory and all subdirectories for the past 14 days by datestamp. bash$ find . -mtime -14 -type f | while read line; do echo -n `ls -l –time-style=’+%s %F %T’ “$line” | […]

No Comments Posted in bash, Security
Tagged , ,
Simple Bash Loop Constructs

Many times it is useful to write an ad-hoc program within bash to accomplish a task. Most of an ad-hoc script is composed of text formatting as well as a loop to get things running. The most useful loop structure that I find in my experience is a do while loop as follows: bash$ ls […]

No Comments Posted in bash
Tagged ,