Skip to content

Instantly share code, notes, and snippets.

@mikejoh
mikejoh / kubectl-one-liners.md
Last active March 13, 2024 08:02
Yet another kubectl one-liners

kubectl one-liners

Enable kubectl completion (needs the bash-completion package):

source <(kubectl completion bash)

Dry-run, outputs Service (--expose) and a Deployment in yaml:

kubectl run --image=apache \ 
--port=80 \
@ekreutz
ekreutz / ansible_variable_precedence.md
Last active April 25, 2024 17:43
Ansible variable precedence (order, hierarchy)
@bboe
bboe / NOTES.txt
Last active February 17, 2021 00:24
BBoe's Updates to "How To Make A reddit Bot — Part One"
Intro:
I'm Bryce (/u/bboe) Author of PRAW
/u/busterroni's Submission:
https://www.reddit.com/r/learnpython/comments/5ury27/heres_a_tutorial_i_made_on_creating_a_reddit_bot/
/u/busterroni's Part 1:
https://www.youtube.com/watch?v=krTUf7BpTc0
@mikeifomin
mikeifomin / wait_for_http.yml
Created October 8, 2016 10:20
Ansible wait_for http
- name: wait_for http
command: "curl --silent {{ url }}"
register: result
until: result.stdout.find("200 OK") != -1
retries: 60
delay: 1
changed_when: false
@alces
alces / ansible_local_playbooks.md
Last active April 5, 2024 18:28
How to run an Ansible playbook locally
  • using Ansible command line:
ansible-playbook --connection=local 127.0.0.1 playbook.yml
  • using inventory:
127.0.0.1 ansible_connection=local
@bgilbert
bgilbert / contextmanager.md
Last active July 19, 2023 10:12
Python context managers

Context managers

In Python, a context manager is an object that can be used in a with statement. Here's a context manager that reports the total wall-clock time spent inside a with block:

import time

class Timer(object):
    def __init__(self, msg):
        self._msg = msg

Docker Container Name

A one paragraph description about the container.

Getting Started

These instructions will cover usage information and for the docker container

Prerequisities

- name: Ensure .ssh directory exists.
file: dest={{ key_file | dirname }} mode=700 owner=ansible state=directory
- name: Install ssh key
copy: content="{{ ssh_key }}" dest={{ key_file }} mode=600 owner=ansible
@magnetikonline
magnetikonline / README.md
Last active April 30, 2024 00:45
Setting Nginx FastCGI response buffer sizes.