Element -- selects all h2
elements on the page
h2 {
foo: bar;
# Windows Performance Counters plugin. | |
# These are the recommended method of monitoring system metrics on windows, | |
# as the regular system plugins (inputs.cpu, inputs.mem, etc.) rely on WMI, | |
# which utilize more system resources. | |
# | |
# See more configuration examples at: | |
# https://github.com/influxdata/telegraf/tree/master/plugins/inputs/win_perf_counters | |
# If metrics are missing run `lodctr /r` as Administrator | |
[[inputs.win_perf_counters]] |
# -*- coding: utf-8 -*- | |
""" | |
pg_uuid | |
~~~~~~~~~~~~~~~~ | |
<NO DESCRIPTION>. | |
:copyright: (c) 2018 by WRDLL <[email protected]> | |
""" | |
from flask import Flask |
// class | |
class ClassCar { | |
drive () { | |
console.log('Vroom!'); | |
} | |
} | |
const car1 = new ClassCar(); | |
console.log(car1.drive()); |
I've been using a lot of Ansible lately and while almost everything has been great, finding a clean way to implement ansible-vault wasn't immediately apparent.
What I decided on was the following: put your secret information into a vars
file, reference that vars
file from your task
, and encrypt the whole vars
file using ansible-vault encrypt
.
Let's use an example: You're writing an Ansible role and want to encrypt the spoiler for the movie Aliens.
from django import forms | |
from django.core.exceptions import ValidationError | |
from django.db import transaction | |
class InvalidInputsError(Exception): | |
def __init__(self, errors, non_field_errors): | |
self.errors = errors | |
self.non_field_errors = non_field_errors |
#!/bin/bash | |
### BEGIN INIT INFO | |
# Provides: php-fpm | |
# Required-Start: $local_fs $remote_fs $network $syslog | |
# Required-Stop: $local_fs $remote_fs $network $syslog | |
# Default-Start: 2 3 4 5 | |
# Default-Stop: 0 1 6 | |
# Short-Description: starts php-fpm daemon | |
# Description: starts php-fpm daemon |
// fluentd conf | |
<source> | |
@type tail | |
path /var/log/nginx/access.log #...or where you placed your Apache access log | |
pos_file /var/log/td-agent/nginx-access.log.pos # This is where you record file position | |
tag nginx.access #fluentd tag! | |
format /^(?<remote>[^ ]*) (?<host>[^ ]*) (?<user>[^ ]*) \[(?<time>[^\]]*)\] "(?<method>\S+)(?: +(?<path>[^\"]*) +\S*)?" (?<code>[^ ]*) (?<size>[^ ]*)(?: "(?<referer>[^\"]*)" "(?<agent>[^\"]*)" "(?<end>)[^\"]*")?$/ | |
time_format %d/%b/%Y:%H:%M:%S %z | |
</source> |
I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6
apt-get update && apt-get install gdb