Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@pcn
pcn / twittermute.txt
Created January 29, 2020 15:33 — forked from IanColdwater/twittermute.txt
Here are some terms to mute on Twitter to clean your timeline up a bit.
Mute these words in your settings here: https://twitter.com/settings/muted_keywords
ActivityTweet
generic_activity_highlights
generic_activity_momentsbreaking
RankedOrganicTweet
suggest_activity
suggest_activity_feed
suggest_activity_highlights
suggest_activity_tweet
Why would this:
```
# This could be expanded into another function to allow for
# reconfiguring more of the clickhouse_config_settings if we find we need
# it in the future.
def config_bg_pool_size(size=2):
"""When replacing a clickhouse node, we want to reduce the background
pool size, because at the default of 8, it'll max out the
resources on its peer nodes as it replicates data to itself.
@pcn
pcn / util.py
Last active July 29, 2021 18:37
Assoc-in and get-in for python
# XXX maybe move this to the util module
# Let's make our lives easier with assoc-in and get-in
# From: https://stackoverflow.com/questions/10578554/equivalent-of-clojures-assoc-in-and-get-in-in-python
# with additional support for deferencing an array
def _assoc_in(dct, path, value, sep=':'):
"""In a dictionary dct, using the path (which is a
<sep>-separated string) assign the resulting key to value,
overwriting it if its present. If it encounters an iterable and the current
path component is an integer, operates on that.
"""
@pcn
pcn / mumblemumble.md
Created July 22, 2019 19:04
Trying to get ES working on ubuntu with openjdk-11
Exception while retrieving instance list from AWS API: Unable to execute HTTP request: Unexpected error: java.security.InvalidAlgorithmParameterException: the trustAnchors parameter must be non-empty
@pcn
pcn / foomap_jinja.md
Created July 17, 2019 20:12
not_working_merge_dicts

This doesn't make a lot of sense to me:

{%   set es_config_per_nodetype = { 'default2': 'default2' } %}
{%   set es_config_per_default = { 'default': 'default' } %}


{% set foo = salt['defaults.merge'](es_config_per_defaults, es_config_per_nodetype) %}

invoking that via:

@pcn
pcn / install_pyenv.sh
Last active April 26, 2019 20:33 — forked from ysaotome/install_pyenv.sh
pyenv install for CentOS 6.5 x86_64
#!/bin/bash
# pyenv install for CentOS 6.5 x86_64
yum install -y gcc gcc-c++ make git patch openssl-devel zlib-devel readline-devel sqlite-devel bzip2-devel
git clone git://github.com/yyuu/pyenv.git ~/.pyenv
export PATH="$HOME/.pyenv/bin:$PATH"
eval "$(pyenv init -)"

Profile:

pcnclickhouse-1-staging:
    provider: <providername>-ec2-private-ips
    image: ami-013608a56ddba236f
    size: t2.medium
    ssh_username: ubuntu
    iam_profile: arn:aws:iam::<accnt-id>:instance-profile/iam_role_tier_blah-c1
    sync_after_install: all
    rename_on_destroy: True
@pcn
pcn / main.go
Created January 28, 2019 02:32
Further down the skycfg/protobof/envoy rabbit hole
package main
import (
"context"
"fmt"
"reflect"
docopt "github.com/docopt/docopt-go"
"github.com/gogo/protobuf/jsonpb"
@pcn
pcn / main.go
Created January 15, 2019 15:40
skycfg and envoy are disagreeing on how to represent this time duration
package main
import (
"context"
"fmt"
"reflect"
docopt "github.com/docopt/docopt-go"
"github.com/gogo/protobuf/jsonpb"
@pcn
pcn / error.md
Created November 2, 2018 19:06
Why is the lazyloader not loading this up?
2018-11-02 19:04:19,094 [salt.loaded.ext.engines.autoscale_ecs][WARNING ] AUTOSCALE: Got an unhandled exception: Traceback (most recent call last):
  File "/srv/salt/engines/autoscale_ecs.py", line 357, in start
    result = _process_message(msg_data)
  File "/srv/salt/engines/autoscale_ecs.py", line 285, in _process_message
    return event_handler(msg)
  File "/srv/salt/engines/autoscale_ecs.py", line 178, in launch_instance
    if _instance_launch(msg['EC2InstanceId'], msg['Region']):
  File "/srv/salt/engines/autoscale_ecs.py", line 82, in _instance_launch
    rc.cmd('cloudaws.enabled_detailed_monitoring', [instance_id])