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 | |
mkdir /etc/httpd/ssl | |
cd /etc/httpd/ssl | |
echo -e "Enter your virtual host FQDN: \nThis will generate the default name for Apache SSL Certificate and Key!" | |
read cert | |
openssl genpkey -algorithm RSA -pkeyopt rsa_keygen_bits:2048 -out $cert.key | |
chmod 600 $cert.key | |
openssl req -new -key $cert.key -out $cert.csr |
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
function render($template, array $params = array(), array $options = array()) { | |
$session = $this->getSession(); | |
if(!isset($params['isAjax']) && !$this->is('ajax')) { | |
if($this->isLoggedIn()) { | |
$params['nombre'] = $session->get('nombre'); | |
} |
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
/** | |
* jQuery Retraso - Simple plugin de jQuery para definir un retraso (al estilo del setInterval() ). | |
* Copyright (c) 2009 Alfredo Juarez | http://juvasoft.com | |
* | |
*/ | |
$.fn.retraso = function( time, name ) { | |
return this.queue( ( name || "fx" ), function() { | |
var self = this; |
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
function sl_use_javascript($js) | |
{ | |
$config = sfConfig::get('app_sl_asset_javascript'); | |
$env = sfConfig::get('sf_environment'); | |
if ($env == 'prod') | |
{ | |
if (isset($config[$j]['version']) && $config[$js]['version'] > 0) | |
{ | |
use_javascript($js.'.'.$config[$js]['version'].'.min.js'); |
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 | |
$category = array | |
( | |
'category' => array | |
( | |
'action' => 'category/add', | |
'method' => 'post', | |
'legend' => 'Add Category', | |
'class' => 'span10', |
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 | |
// Upload a file on Amazon S3 | |
require_once '/vendor/AWSSDKforPHP/sdk.class.php'; | |
$file = $_FILES['file']; | |
$s3 = new AmazonS3($access, $secret); // your amazon s3 credentials. | |
$awsResponse = $s3->create_object($bucketName, $file['name'], array( | |
'fileUpload' => fopen($file['tmp_name'], 'r'), | |
'contentType' => $file['type'], |
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 | |
/** download a file on Amazon s3 */ | |
// amazon s3 credentials. | |
$access = ''; | |
$secret = ''; | |
$file = $bucket . "/" . urlencode('fileName.ext'); | |
$downExp = time() + 10; |
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
CREATE TABLE IF NOT EXISTS `user` ( | |
`id` int(11) NOT NULL AUTO_INCREMENT, | |
`firstName` varchar(255) DEFAULT NULL, | |
`lastName` varchar(255) DEFAULT NULL, | |
`username` varchar(255) NOT NULL, | |
`email` varchar(255) NOT NULL, | |
`enabled` tinyint(1) NOT NULL, | |
`salt` varchar(255) DEFAULT NULL, | |
`password` varchar(255) NOT NULL, | |
`website` varchar(255) DEFAULT NULL, |
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 | |
echo "<h3> Symmetric Encryption </h3>"; | |
$key_value = "KEYVALUE"; | |
$plain_text = "PLAINTEXT"; | |
$encrypted_text = mcrypt_ecb(MCRYPT_DES, $key_value, $plain_text, MCRYPT_ENCRYPT); | |
echo "<p><b> Text after encryption : </b>"; | |
echo $encrypted_text; |
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 | |
FILES=/home/alfrek/databases/*.sql | |
for f in $FILES | |
do | |
echo "Importing $f ..." | |
# take action on each file. $f store current file name | |
mysql -u root -p < $f | |
echo "Finished importing $f" | |
done |
OlderNewer