This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
############################################ | |
# don't forget to chmod +x reset_database # | |
# usage: ./reset_database dbname # | |
# enter db password when prompted # | |
############################################ | |
# set the database name | |
DATABASE_NAME=$1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
################################################ | |
# # | |
# Don't forget to make this file executable # | |
# (chmod +x optimize_dir) # | |
# # | |
# Improvements are always welcomed and # | |
# encouraged # | |
# Added a "sizes" parameter to only get image # |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* @author mocanuga | |
* @desc Return the size of directory in bytes. Tested on CentOS 5.11 Final | |
* @return int | |
*/ | |
function getFolderSize($folder = '') { | |
if(empty($folder)) | |
return -1; | |
$dir = escapeshellcmd($folder); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ErrorDocument 404 NotFound | |
ServerSignature Off | |
Options +FollowSymLinks | |
<IfModule mod_rewrite.c> | |
RewriteEngine on | |
RewriteCond %{REQUEST_FILENAME} !-f | |
RewriteCond %{REQUEST_FILENAME} !-d |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* @author mocanuga | |
* @desc Return the operator for a phone number for Italy | |
* @return string | |
*/ | |
function phoneOperator ($phone) { | |
if(!preg_match('/((313)|(3[2-9]{1}[0-9]{1}))([0-9]{7})/', $phone)) // invalid Italy mobile number | |
return 'unkown'; | |
$mobileOperators = array( | |
'/^313/' => 'Rete Ferroviaria Italiana', |