This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# original code stolen from https://stackoverflow.com/questions/37721314/ansible-putting-facts-in-sqlite-via-callback | |
from ansible.plugins.callback import CallbackBase | |
import os | |
import time | |
import sqlite3 | |
dbname = './test.db' | |
TIME_FORMAT='%Y-%m-%d %H:%M:%S' | |
try: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class InventoryParser | |
def initialize(inventory_path) | |
@inventory_path = inventory_path | |
@data = { | |
"_meta" => { | |
"hostvars" => {} | |
} | |
} | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// http://weblog.shank.in/input-template-go-for-algorithmic-competitions/ | |
package main | |
import ( | |
"bufio" | |
"io" | |
"os" | |
"strconv" | |
"strings" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Source: https://gist.github.com/d8113b6f149583e1cf1614d76f2a4182 | |
##################################################################### | |
# How To Create, Provision, And Operate Kubernetes With Cluster API # | |
# https://youtu.be/8yUDUhZ6ako # | |
##################################################################### | |
# Referenced videos: | |
# - Should We Replace Docker Desktop With Rancher Desktop?: https://youtu.be/bYVfCp9dRTE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Source: https://gist.github.com/c7cdfef142bd65cc744789d3c1e90170 | |
########################################### | |
# Talos Linux: OS Designed For Kubernetes # | |
# https://youtu.be/iEFb2Zg4xUg # | |
########################################### | |
# Additional Info: | |
# - Talos Linux: https://www.talos.dev/ | |
# - How To Create, Provision, And Operate Kubernetes With Cluster API (CAPI): https://youtu.be/8yUDUhZ6ako |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"io/ioutil" | |
"log" | |
"gopkg.in/fsnotify.v1" | |
) | |
func main() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
redis: | |
image: redis | |
ports: | |
- "6379:6379" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
export B2_ACCOUNT_ID=<your keyID here> | |
export B2_ACCOUNT_KEY=<your key here> | |
export RESTIC_PASSWORD=<your restic repository password here> | |
command1="restic -r b2:mybucket-desktop-backups:alfred/ backup /home/eric/Documents/ 2>&1" | |
output1=$(eval "${command1}") | |
result1=$? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# | |
## example running it from cron | |
# MAILTO="" | |
# SHELL=/bin/bash | |
# VERBOSE=1 | |
# CMD_ON_FAILURE='/etc/init.d/nginx reload' | |
# * * * * * root timeout -k 2 5 /tmp/check_dns.sh upstream.server.com 2>>/var/log/check_dns.log | |
# * * * * * root sleep 10 && sed -e :a -e '$q;N;501,$D;ba' -i /var/log/check_dns.log | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
image: node:16 | |
stages: | |
- build | |
- test | |
build: | |
stage: build | |
rules: | |
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH |