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 | |
if [ -z "$1" ] | |
then | |
echo "Please provide a domain name as argument" | |
exit 1 | |
fi | |
DOMAIN=$1 | |
IP=`dig +short A $DOMAIN` |
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/sh | |
ADMIN_PASS=`cat /etc/psa/.psa.shadow` | |
MYSQL_BIN_D=`grep MYSQL_BIN_D /etc/psa/psa.conf | awk '{print $2}'` | |
PRODUCT_ROOT_D=`grep PRODUCT_ROOT_D /etc/psa/psa.conf | awk '{print $2}'` | |
mysql="${MYSQL_BIN_D}/mysql -N -uadmin -p${ADMIN_PASS} psa" | |
query="select name from domains;" | |
domains=`echo $query | $mysql ` |
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 | |
namespace Codeception\Module; | |
/** | |
* Additional methods for DB module | |
* | |
* Save this file as DbHelper.php in _support folder | |
* Enable DbHelper in your suite.yml file | |
* Execute `codeception build` to integrate this class in your codeception | |
*/ |
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
dig +short myip.opendns.com @resolver1.opendns.com |
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 | |
function build_calendar($month, $year) { | |
$daysOfWeek = array('S','M','T','W','T','F','S'); | |
$firstDayOfMonth = mktime(0,0,0,$month,1,$year); | |
$numberDays = date('t',$firstDayOfMonth); | |
$dateComponents = getdate($firstDayOfMonth); | |
$monthName = $dateComponents['month']; | |
$dayOfWeek = $dateComponents['wday']; | |
$calendar = "<table class='calendar'>"; | |
$calendar .= "<caption>$monthName $year</caption>"; |
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 | |
header("Content-Type: text/plain"); | |
function strip_html_tags( $text ) | |
{ | |
$text = preg_replace( | |
array( | |
// Remove invisible content | |
'@<head[^>]*?>.*?</head>@siu', | |
'@<style[^>]*?>.*?</style>@siu', |
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 | |
/** | |
* Wordpress shell script | |
* Explore Upload folder to remove unused files and save disk space | |
* | |
* @category Wordpress | |
* @package Wordpress.shell | |
* | |
* @author Alexander Garzon <[email protected]> | |
* @license http://www.gnu.org/copyleft/gpl.html GNU General Public License |
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
version=1.017R | |
echo "\n* Downloading version $version of source code pro font" | |
rm -f SourceCodePro_FontsOnly-$version.zip | |
rm -rf SourceCodePro_FontsOnly-$version | |
wget https://github.com/downloads/adobe/source-code-pro/SourceCodePro_FontsOnly-$version.zip | |
echo "\n* Unziping package" | |
unzip SourceCodePro_FontsOnly-$version.zip | |
mkdir -p ~/.fonts |
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 | |
#Author: Alexander Garzon | |
ERROR() { | |
echo $0 ERROR: $1 >&2 | |
exit 2 | |
} | |
# -- Sanity check on parameters | |
[ $# -ne 1 ] && ERROR 'Please provide video file' |
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
var diffSeconds = Math.round(new Date("September 21, 2013 12:00:00 PM").getTime()/1000.0) - Math.round(new Date().getTime()/1000.0); | |
var days = Math.floor(diffSeconds / 86400); | |
var hours = Math.floor(diffSeconds / 3600) % 24; | |
var minutes = Math.floor(diffSeconds / 60) % 60; | |
var seconds = diffSeconds % 60; | |
function pad(number, length) { | |
var str = '' + number; | |
while (str.length < length) { | |
str = '0' + str; |