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
import time | |
from sentence_transformers import SentenceTransformer | |
model = SentenceTransformer( | |
f"sentence-transformers/all-MiniLM-L6-v2", device="cpu" | |
) | |
suggestion = """ | |
- name: Git checkout | |
ansible.builtin.git: | |
accept_newhostkey: true |
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 | |
server='https://vcenter.test' | |
password='z!Zq4Y&`/!E(o<br?:L>' | |
session_id=$(curl -q -X POST -k -u "administrator@vsphere.local:${password}" ${server}/rest/com/vmware/cis/session|jq -r .value) | |
for i in $(seq 10); do | |
curl -ik -H 'Accept:application/json' -H "vmware-api-session-id:${session_id}" -X GET ${server}/rest/vcenter/cluster | |
done |
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 | |
set -eux | |
function cleanup() | |
{ | |
echo "Something went wrong! Let's clean up." | |
} | |
trap cleanup EXIT |
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
# | |
# (c) 2022 Red Hat Inc. | |
# | |
# This file is part of Ansible | |
# GNU General Public License v3.0+ (see COPYING or https://www.gnu.org/licenses/gpl-3.0.txt) | |
from __future__ import (absolute_import, division, print_function) | |
__metaclass__ = type | |
import pytest |
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 python3 | |
import argparse | |
from datetime import datetime | |
import requests | |
import re | |
class TimedOut(Exception): |
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 | |
set -eux | |
for i in $(seq 9); do | |
gsettings set org.gnome.shell.keybindings switch-to-application-$i '[]' | |
gsettings set org.gnome.desktop.wm.keybindings switch-to-workspace-$i "['<Super>$i']" | |
done | |
gsettings set org.gnome.desktop.wm.keybindings toggle-fullscreen "['<Super>f']" | |
#gsettings set org.gnome.desktop.wm.keybindings toggle-maximized "['<Super>f']" | |
gsettings set org.gnome.desktop.interface enable-animations false |
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 python3 | |
import boto3 | |
from datetime import datetime | |
client = boto3.client("cloudtrail") | |
import json | |
instances = {} |
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 python3 | |
# Identify the minimal subset of permission required for a given Ansible playbook | |
# License: GPLv3+ | |
# Copyright: Gonéri Le Bouder <goneri@lebouder.net> | |
from pyVmomi import vim | |
from pyVim.connect import SmartConnect, SmartConnectNoSSL, Disconnect | |
import os | |
import subprocess |
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 fish | |
# License: GPLv3+ | |
# Usage: | |
# To start a venv with the default python3 and Ansible devel: | |
# . ~/bin/ansible-venv.fish | |
# | |
# To start a venv with a specific version: | |
# . ~/bin/ansible-venv.fish 3.4 stable-2.9 | |
# See: https://goneri.lebouder.net/2021/06/02/ansible-collections-and-venv/ |
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 | |
for i in $(ls /sys/class/net/); do | |
echo -n "${i}: " | |
firewall-cmd --get-zone-of-interface=${i} | |
done |
NewerOlder