Skip to content

Instantly share code, notes, and snippets.

@weibeld
weibeld / 01-hello-world.yml
Last active May 1, 2024 13:53
GitHub Actions example workflow 1 — Hello World!
name: hello-world
on: push
jobs:
my-job:
runs-on: ubuntu-latest
steps:
- name: my-step
run: echo "Hello World!"
@fty4
fty4 / ansible_concatenate-list-of-dict.yml
Last active March 6, 2022 13:55
ansible concatenate item / element of list of dictionaries / dict
---
- name: concatenate list elements of dictionary
hosts: all
gather_facts: no
vars:
users:
- username: alice
email: alice@example.com
- username: bob
email: bob@example.com
@rmoff
rmoff / kafkacat.adoc
Last active January 5, 2024 19:59
Show last three messages from a Kafka topic with kafkacat
kafkacat -b localhost:9092 \
         -t _kafka-connect-group-01-status \
         -C \
         -o-3 \
         -c3 \
         -f 'Topic %t / Partition %p / Offset: %o / Timestamp: %T\nHeaders: %h\nKey (%K bytes): %k\nPayload (%S bytes): %s\n--\n'
@milesbxf
milesbxf / monzo-alertmanager-config.yaml
Last active May 6, 2024 13:26
Monzo's Alertmanager Slack templates
###################################################
##
## Alertmanager YAML configuration for routing.
##
## Will route alerts with a code_owner label to the slack-code-owners receiver
## configured above, but will continue processing them to send to both a
## central Slack channel (slack-monitoring) and PagerDuty receivers
## (pd-warning and pd-critical)
##
@quiver
quiver / iam-policy.json
Last active April 23, 2024 07:02
How to connect to Amazon RDS PostgreSQL with IAM credentials
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"rds-db:connect"
],
"Resource": [
"arn:aws:rds-db:region:account-id:dbuser:dbi-resource-id/database-user-name"
@devasat
devasat / aws-cli.sh
Last active October 12, 2023 12:16
AWS CLI Examples
# ********** EC2 ***********
# describe ec2 instances
aws ec2 describe-instances \
--query 'Reservations[*].Instances[*].[InstanceId,Tags[?Key==`Name`].Value|[0],State.Name,
PrivateIpAddress,PublicIpAddress]' \
--output table
# stopped instances
@rmoff
rmoff / List all available Kafka Connect plugins.md
Created May 18, 2018 14:29
List all available Kafka Connect plugins
$ curl -s -XGET http://localhost:8083/connector-plugins|jq '.[].class'

"io.confluent.connect.activemq.ActiveMQSourceConnector"
"io.confluent.connect.elasticsearch.ElasticsearchSinkConnector"
"io.confluent.connect.hdfs.HdfsSinkConnector"
"io.confluent.connect.hdfs.tools.SchemaSourceConnector"
"io.confluent.connect.ibm.mq.IbmMQSourceConnector"
"io.confluent.connect.jdbc.JdbcSinkConnector"
"io.confluent.connect.jdbc.JdbcSourceConnector"

"io.confluent.connect.jms.JmsSourceConnector"

@huevos-y-bacon
huevos-y-bacon / aws_ec2_termination_protection.md
Last active May 8, 2024 07:44
Enable or disable EC2 instance "Termination Protection" via AWS CLI (shell)

Loop through all EC2 instances (excluding terminated and spot) and enable termination protection

for I in $(aws ec2 describe-instances --query \
  'Reservations[].Instances[?(InstanceLifecycle!=`spot` && InstanceState!=`terminated`)].[InstanceId]' \
  --output text); do
  aws ec2 modify-instance-attribute --disable-api-termination --instance-id $I;
done
@StevenACoffman
StevenACoffman / fluent-filebeat-comparison.md
Last active April 2, 2024 22:34
Fluentd Fluent-bit FileBeat memory and cpu resources

Fluent-bit rocks

A short survey of log collection options and why you picked the wrong one. 😜

Who am I? Where am I from?

I'm Steve Coffman and I work at Ithaka. We do JStor (academic journals) and other stuff. How big is it?

Number what it means
101,332,633 unique visitors in 2017
@rkuzsma
rkuzsma / get-k8s-node-ip-addresses.sh
Created January 5, 2017 03:33
Get external IP address of Kubernetes nodes
#!/bin/bash
kubectl get nodes --selector=kubernetes.io/role!=master -o jsonpath={.items[*].status.addresses[?\(@.type==\"ExternalIP\"\)].address}