# disk usage
df -h
# clear logs
find /var/sentora/logs -name "*.log" -exec bash -c 'echo "" > {}' \;
find /var/log -name "*.log" -exec bash -c 'echo "" > {}' \;
# clear bolt cache (all sites)
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
{"metadata":{"version":4.3,"type":"Object","generator":"ObjectExporter"},"geometries":[{"uuid":"39baa819-52f2-451b-bc52-66ea26984b23","type":"Geometry","data":{"vertices":[0,0.5,0.5,0.25,0.5,0.433,0.433,0.5,0.25,0.5,0.5,0,0.433,0.5,-0.25,0.25,0.5,-0.433,0,0.5,-0.5,-0.25,0.5,-0.433,-0.433,0.5,-0.25,-0.5,0.5,0,-0.433,0.5,0.25,-0.25,0.5,0.433,0,0.4,0.5,0.25,0.4,0.433,0.433,0.4,0.25,0.5,0.4,0,0.433,0.4,-0.25,0.25,0.4,-0.433,0,0.4,-0.5,-0.25,0.4,-0.433,-0.433,0.4,-0.25,-0.5,0.4,0,-0.433,0.4,0.25,-0.25,0.4,0.433,0,0.3,0.5,0.25,0.3,0.433,0.433,0.3,0.25,0.5,0.3,0,0.433,0.3,-0.25,0.25,0.3,-0.433,0,0.3,-0.5,-0.25,0.3,-0.433,-0.433,0.3,-0.25,-0.5,0.3,0,-0.433,0.3,0.25,-0.25,0.3,0.433,0,0.2,0.5,0.25,0.2,0.433,0.433,0.2,0.25,0.5,0.2,0,0.433,0.2,-0.25,0.25,0.2,-0.433,0,0.2,-0.5,-0.25,0.2,-0.433,-0.433,0.2,-0.25,-0.5,0.2,0,-0.433,0.2,0.25,-0.25,0.2,0.433,0,0.1,0.5,0.25,0.1,0.433,0.433,0.1,0.25,0.5,0.1,0,0.433,0.1,-0.25,0.25,0.1,-0.433,0,0.1,-0.5,-0.25,0.1,-0.433,-0.433,0.1,-0.25,-0.5,0.1,0,-0.433,0.1,0.25,-0.25,0.1,0.433,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
{"metadata":{"version":4.3,"type":"Object","generator":"ObjectExporter"},"geometries":[{"uuid":"85ee7973-d280-47fe-b48e-d696621abca6","type":"Geometry","data":{"vertices":[],"normals":[],"faces":[]}},{"uuid":"83a1d57d-087b-4d15-987f-dc00ee7b5669","type":"Geometry","data":{"vertices":[250.000244140625,59.999908447265625,120,270.000244140625,59.999908447265625,120,250.000244140625,159.9999542236328,120,270.000244140625,159.9999542236328,120,270.000244140625,-40.000038146972656,120,250.052490234375,-40.000038146972656,120,250.052490234375,-59.999961853027344,120,270.000244140625,-59.999961853027344,120,39.999755859375,30.000022888183594,120,100.000244140625,30.000022888183594,120,39.999755859375,39.999900817871094,120,120.000244140625,39.999900817871094,120,120.00022888183594,-160,120,100.000244140625,-160,120,-270.000244140625,-159.99993896484375,120.00000762939453,-249.999755859375,-159.99993896484375,120.00000762939453,-249.999755859375,-119.99999237060547,120.00000762939453,-270.000244140625,-119.99999237060 |
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 | |
// post data | |
$data = json_decode(file_get_contents("php://input")); | |
// config | |
$email = ""; | |
$from = ""; | |
$subject = ""; | |
// validations |
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 items = Array.prototype.slice.call( | |
document.querySelectorAll('*') | |
).map(function(element) { | |
var listeners = getEventListeners(element); | |
return { | |
element: element, | |
listeners: Object.keys(listeners).map(function(k) { | |
return { event: k, listeners: listeners[k] }; | |
}) | |
}; |
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
// https://stackoverflow.com/questions/18499909/how-to-count-total-number-of-watches-on-a-page | |
(function () { | |
var root = angular.element(document.getElementsByTagName('body')); | |
var watchers = []; | |
var f = function (element) { | |
angular.forEach(['$scope', '$isolateScope'], function (scopeProperty) { | |
if (element.data() && element.data().hasOwnProperty(scopeProperty)) { | |
angular.forEach(element.data()[scopeProperty].$$watchers, function (watcher) { |
En Drupal 7 se 'mergearon' los usuarios, nodos y taxonomías en una entidad. Las entidades pueden tener campos adicionales a los que ya tenían. Adicionalmente, cada campo puede estar traducido y, por lo tanto, tener distintos valores dependiendo del idioma. En general es mejor acceder a los valores de los campos via APIs en lugar de acceder directamente al campo. Listamos algunas de las funciones más útiles y recomendadas para utilizar:
- entity_load() - permite cargar una entidad. Los tipos de las entidades pueden ser 'node', 'user', etc. Ver: entity_load()
- field_get_items() - devuelve, dada una entidad y el nombre de un campo la lista de valores que contiene el campo. Ver: field_get_values()
- field_view_value() - devuelve un array rendereable con el valor. Para obtener HTML hacer drupal_rend
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
// for jquery | |
$( document ).ready(function() { | |
$(".smoothScroll").on('click', function(e){ | |
smoothScroll(e); | |
}) | |
}); |
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 | |
# $1 user | |
# $2 from path | |
# prerequisites: | |
# create sftp-only group | |
# sudo groupadd sftp-only | |
# add sftp-only configurations | |
# we need to modify the ssh configuration on file /etc/ssh/sshd_config replacing the following line: |
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 | |
# $1 user | |
# $2 from path | |
# prerequisites: | |
# create sftp-only group | |
# sudo groupadd sftp-only | |
# add sftp-only configurations | |
# we need to modify the ssh configuration on file /etc/ssh/sshd_config replacing the following line: |