show dbs
I often find myself ssh'ing into my servers and checking my systemd service logs with $ journalctl -f -u {name}.service
. One day I got tired of this and wanted all of my important logs in once place (Amazon AWS Cloudwatch). To my dismay, there weren't any real good tutorials on how to do so. So, voilà.
Overall, it's a fairly simple process consisting of the following few steps.
Open the service file with $ sudo vi /lib/systemd/system/{name}.service
Modify the [Service]
section:
# Change YOUR_TOKEN to your prerender token and uncomment that line if you want to cache urls and view crawl stats | |
# Change example.com (server_name) to your website url | |
# Change /path/to/your/root to the correct value | |
# Generate $prerender_ua bool value based on user agent | |
# indexation bots will get this as 1, | |
# prerender user agent will always get 0 (avoid loops) | |
map $http_user_agent $prerender_ua { | |
default 0; |
Follow the installation instructions on the Airflow website.
To configure Airflow to use Postgres rather than the default Sqlite3, go to airflow.cfg
and update this configuration to LocalExecutor
:
# The executor class that airflow should use. Choices include
package main | |
import "fmt" | |
// Constant definitions | |
const MaxUint = ^uint(0) | |
const MinUint = 0 | |
const MaxInt = int(^uint(0) >> 1) | |
const MinInt = -MaxInt - 1 |
#!/usr/bin/env bash | |
set -e | |
# clear coverage.out | |
cp /dev/null coverage.out | |
for d in $(go list ./... | grep -v vendor); do | |
go test -race -coverprofile=profile.out -covermode=atomic $d | |
if [ -f profile.out ]; then | |
cat profile.out >> coverage.out |
# Redis Cheatsheet | |
# All the commands you need to know | |
redis-server /path/redis.conf # start redis with the related configuration file | |
redis-cli # opens a redis prompt | |
# Strings. |
import os | |
import unittest | |
from airflow.models import DagBag | |
class TestDags(unittest.TestCase): | |
""" | |
Generic tests that all DAGs in the repository should be able to pass. | |
""" |
Hi Nicholas,
I saw you tweet about JSX yesterday. It seemed like the discussion devolved pretty quickly but I wanted to share our experience over the last year. I understand your concerns. I've made similar remarks about JSX. When we started using it Planning Center, I led the charge to write React without it. I don't imagine I'd have much to say that you haven't considered but, if it's helpful, here's a pattern that changed my opinion:
The idea that "React is the V in MVC" is disingenuous. It's a good pitch but, for many of us, it feels like in invitation to repeat our history of coupled views. In practice, React is the V and the C. Dan Abramov describes the division as Smart and Dumb Components. At our office, we call them stateless and container components (view-controllers if we're Flux). The idea is pretty simple: components can't