Skip to content

Instantly share code, notes, and snippets.

View copolycube's full-sized avatar
💭
I may be slow to respond.

Copolycube copolycube

💭
I may be slow to respond.
View GitHub Profile
#!/usr/bin/env python3
# https://grafana.com/docs/http_api/annotations/
import os
import sys
import json
import requests
import argparse
import datetime
@copolycube
copolycube / docker-compose.yml
Last active March 28, 2022 21:16
Traefik v2 + monitoring (cadvisor, node-exporter, netdata, whoami) dynamic routing
version: '3'
networks:
web:
external: true
internal:
external: false
volumes:
netdataconfig:
@copolycube
copolycube / pandoc-cheatsheet.md
Created June 1, 2021 19:24 — forked from cferdinandi/pandoc-cheatsheet.md
CLI cheats for creating a markdown ebook with Pandoc.

epub

pandoc assets/metadata.yml chapters/*.md -o book.epub -S

pdf

Using WKHTMLtoPDF (no page numbers)

@copolycube
copolycube / sample.yml
Last active June 15, 2020 15:42 — forked from eyasuyuki/sample.yml
Ansible playbook example before install Fluentd (ansible 2.9)
- hosts: all
remote_user: admin-cloud
sudo: yes
vars:
limits_conf: /etc/security/limits.conf
sysctl_conf: /etc/sysctl.conf
tasks:
- name: before install fluentd check ulimit
shell: grep "{{ item }}" {{ limits_conf }}
with_items:
@copolycube
copolycube / aws_security_group_details.sh
Last active April 30, 2020 21:15 — forked from richadams/aws_security_group_details.sh
A quick and dirty script to list out all security group settings on an AWS account. Barely tested, use at own risk, etc. Requires awscli to be installed.
#!/bin/bash
# Requires: awscli (http://aws.amazon.com/cli/)
# Prints out a list of all security groups and their settings, just for quickly auditing it.
# Your AWS credentials
if [ -z ${AWS_ACCESS_KEY_ID} ]; then
export AWS_ACCESS_KEY_ID='***'
export AWS_SECRET_ACCESS_KEY='***'
fi
@copolycube
copolycube / aws_delete_ami_boto3.py
Created March 16, 2020 14:22 — forked from nirbhabbarat/aws_delete_ami_boto3.py
Delete/Deregister 30 days old AMI in AWS using boto3 and python
#!/usr/bin/env python
##### USE ON YOUR OWN RISK - THIS IS GOING TO DEREGISTER AMI OLDER THAN 30 DAYS
import boto3
from dateutil.parser import parse
import datetime
age = 30
aws_profile_name = 'prod'
def days_old(date):
get_date_obj = parse(date)
@copolycube
copolycube / aws-regions-cmd.sh
Created June 17, 2019 18:55
Execute code over all AWS regions
#!/bin/bash
## oneline : for r in $(aws ec2 describe-regions --query "Regions[].{Name:RegionName}" --output text --region ca-central-1); do echo "---------- AWS Region : $r ----------" ; echo "hello world"; done
for r in $(aws ec2 describe-regions --query "Regions[].{Name:RegionName}" --output text --region ca-central-1);
do
echo "---------- AWS Region : $r ----------" ;
echo "hello world";
done
@copolycube
copolycube / jira.groovy
Created May 3, 2018 04:25 — forked from dkandalov/jira.groovy
Tiny example of using JIRA rest API from groovy
/**
* You might need to import JIRA ssl certificate into your jdk/jre cacerts file:
* 1) save JIRA certificate. E.g. in Chrome right click on https icon, click "Certificate information" link.
* In "Details" tab, click "Copy to File..." button.
* 2) in jdk "bin" folder run: "keytool -importcert -keystore ./cacerts -file /file/from/the/step/above/cacert.crt -trustcacerts -alias jira_ca
*/
class JiraMain {
static void main(String[] args) {
// see https://docs.atlassian.com/jira/REST/latest/
def listWatchers = "https://jira/rest/api/2/issue/PROJ-123/watchers"