This file contains hidden or 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 | |
/* | |
+----------------------------------------------------------------------+ | |
| APC | | |
+----------------------------------------------------------------------+ | |
| Copyright (c) 2006-2011 The PHP Group | | |
+----------------------------------------------------------------------+ | |
| This source file is subject to version 3.01 of the PHP license, | | |
| that is bundled with this package in the file LICENSE, and is | | |
| available through the world-wide-web at the following url: | |
This file contains hidden or 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
{% block version -%} | |
vcl 4.0; | |
{% endblock %} | |
# This Varnish VCL has been adapted from the Four Kitchens VCL for Varnish 3. | |
# Default backend definition. Points to Apache, normally. | |
backend default { | |
{% block backend -%} | |
.host = "{{ varnish_default_backend_host }}"; |
This file contains hidden or 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 | |
# RAM consumed in MB per connection | |
ps -ylC apache2 --sort:rss | awk '{SUM += $8; I += 1} END {print SUM/I/1024}' | |
# System consumed in MB. | |
ps -N -ylC apache2 --sort:rss | awk '{SUM += $8} END {print SUM/1024}' | |
(RAMTOTAL – RAM_RESTOPROCESOS) / RAM_POR_CONEXIÓN |
This file contains hidden or 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 | |
/** | |
* Set redis configuration. | |
*/ | |
/** @see: https://docs.platform.sh/frameworks/drupal8/redis.html */ | |
if (extension_loaded('redis')) { | |
// Set Redis as the default backend for any cache bin not otherwise specified. | |
// $settings['cache']['default'] = 'cache.backend.redis'; |
This file contains hidden or 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
aptitude install optipng jpegoptim | |
optipng *.png | |
jpegoptim *.jpg |
This file contains hidden or 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 Drupal\view_mode_page\Controller; | |
use Drupal\Core\Controller\ControllerBase; | |
use Drupal\Core\Routing\AccessAwareRouterInterface; | |
use Symfony\Component\DependencyInjection\ContainerInterface; | |
use Symfony\Component\HttpFoundation\RequestStack; | |
use Symfony\Component\HttpKernel\HttpKernelInterface; |
This file contains hidden or 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 | |
// $id = some node ID | |
// $field = field name for entity reference field | |
$node = Node::load($id); | |
/** @var \Drupal\Core\Field\Plugin\Field\FieldType\EntityReferenceItem $referenceItem */ | |
$referenceItem = $node->get($field)->first(); | |
/** @var \Drupal\Core\Entity\Plugin\DataType\EntityReference $entityReference */ | |
$entityReference = $referenceItem->get('entity'); |
This file contains hidden or 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 | |
# KO memcache: http://cgit.drupalcode.org/memcache/tree/README.txt?h=8.x-2.x | |
//$settings['memcache']['servers'] = ['memcached:11211' => 'default']; | |
//$settings['memcache']['bins'] = ['default' => 'default']; | |
//$settings['memcache']['key_prefix'] = ''; | |
/** | |
* Memcache Configuration. | |
*/ | |
/* |
This file contains hidden or 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
require "rubygems" | |
require "twitter" | |
require "json" | |
# things you must configure | |
TWITTER_USER = "your_username" | |
MAX_AGE_IN_DAYS = 1 # anything older than this is deleted | |
# get these from dev.twitter.com | |
CONSUMER_KEY = "your_consumer_key" |
This file contains hidden or 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
#!/usr/bin/bash | |
sudo apt-get install git | |
git clone https://github.com/jeremyb31/ath10k-firmware.git | |
sudo cp -r ath10k-firmware/ /lib/firmware/ath10k/ |