(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| #!/bin/bash | |
| echo "" | |
| echo "`date`: RUNNING: brew update" | |
| /usr/local/bin/brew update | |
| echo "`date`: FINISHED: brew update" | |
| echo "" |
| $ wp post list --format=ids | xargs wp post update --comment_status=closed | |
| # Output: | |
| # Success: Updated post 2514. | |
| # Success: Updated post 2511. | |
| # Success: Updated post 2504. | |
| # Success: Updated post 2499. | |
| # Success: Updated post 2441. | |
| # etc... |
| # | |
| # Customized VCL file for serving up a Drupal site with multiple back-ends. | |
| # | |
| # Based on this excellent Lullabot article: | |
| # http://www.lullabot.com/articles/varnish-multiple-web-servers-drupal | |
| # | |
| # Hooks for New Relic | |
| C{ | |
| #include <sys/time.h> |
(by @andrestaltz)
If you prefer to watch video tutorials with live-coding, then check out this series I recorded with the same contents as in this article: Egghead.io - Introduction to Reactive Programming.
| <?php | |
| /** | |
| * Implements hook_drush_command(). | |
| */ | |
| function seed_derivatives_drush_command() { | |
| $items = array(); | |
| $items['seed_derivatives'] = array( | |
| 'description' => "Create image derivatives", |
| <?php | |
| use Psr\Log\LoggerInterface; | |
| /** | |
| * Assembles and dispatches the SOAP request body XML and returns the | |
| * Response body XML from the vendor API. | |
| */ | |
| class Request | |
| { |
| WAN addr: 81.167.4.214 | |
| eth0 = LAN | |
| $ ipv6calc --action 6rd_local_prefix --6rd_prefix 2a01:79c::/30 --6rd_relay_prefix 213.167.115.92/0 81.167.4.214 | |
| 2a01:79d:469c:1358::/62 | |
| sudo ip tunnel add 6rdtun mode sit local 81.167.4.214 ttl 64 | |
| sudo ip tunnel 6rd dev 6rdtun 6rd-prefix 2a01:79c::/30 | |
| sudo ip link set 6rdtun up |
| # to generate your dhparam.pem file, run in the terminal | |
| openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048 |
| from datetime import datetime | |
| from sqlalchemy import Column, Integer, DateTime, ForeignKey | |
| from sqlalchemy.orm import relationship | |
| from sqlalchemy.ext.declarative import declared_attr | |
| from flask_security import current_user | |
| class AuditMixin(object): | |
| created_at = Column(DateTime, default=datetime.now) | |
| updated_at = Column(DateTime, default=datetime.now, onupdate=datetime.now) |
| /ipv6 firewall filter | |
| add action=accept chain=input comment="Allow established connections" connection-state=established disabled=no | |
| add action=accept chain=input comment="Allow related connections" connection-state=related disabled=no | |
| add action=accept chain=input comment="Allow limited ICMP" disabled=no limit=50/5s,5 protocol=icmpv6 | |
| add action=accept chain=input comment="Allow UDP" disabled=no protocol=udp | |
| add action=drop chain=input comment="" disabled=no | |
| add action=accept chain=forward comment="Allow any to internet" disabled=no out-interface=sit1 | |
| add action=accept chain=forward comment="Allow established connections" connection-state=established disabled=no | |
| add action=accept chain=forward comment="Allow related connections" connection-state=related disabled=no | |
| add action=drop chain=forward comment="" disabled=no |