Skip to content

Instantly share code, notes, and snippets.

View mfominov's full-sized avatar

Maksim Fominov mfominov

View GitHub Profile

Keybase proof

I hereby claim:

  • I am mfominov on github.
  • I am mfominov (https://keybase.io/mfominov) on keybase.
  • I have a public key ASAh6m40dqQ1zFOO-2P6oH1VW6HY0ltVMIP_10ieRYiibQo

To claim this, I am signing this object:

@mfominov
mfominov / ldap2json.sh
Last active April 10, 2023 06:54 — forked from deardooley/ldap2json.sh
Parse output of ldapsearch to json
#!/usr/bin/env bash
# ldap2json.sh
#
# Example shell script showing how to parse LDIF output from the
# ldapsearch command into a json array. Please note that this
# script almost certainly does not handle every edge case, and
# is best used to pull a handful of fields a user or group
# record in a FreeIPA ldap server and format them as JSON for use
# in other tools.
@mfominov
mfominov / wireguard.json
Last active February 22, 2023 10:06
wireguard dashboard
{
"annotations": {
"list": [
{
"builtIn": 1,
"datasource": {
"type": "datasource",
"uid": "grafana"
},
"enable": true,
@mfominov
mfominov / bitwarden.py
Last active March 18, 2022 09:10
Vautlwarden ansible lookup plugin
# python 3 headers, required if submitting to Ansible
from __future__ import absolute_import, division, print_function
__metaclass__ = type
DOCUMENTATION = """
lookup: bitwarden
author: Maksim Fominov <maxfominov@gmail.com>
version_added: "1.0"
short_description: fast lookup of secrets stored in bitwarden
@mfominov
mfominov / certificates-cronjob.yaml
Last active June 8, 2021 07:26
Update let's encrypt certs in Yandex cloud with cronjob
apiVersion: batch/v1beta1
kind: CronJob
metadata:
name: example.com
spec:
schedule: "0 0 * * *"
jobTemplate:
spec:
template:
spec:
@mfominov
mfominov / world2shift
Last active December 27, 2021 12:55
move from nginx to nginxinc/nginx-unprivileged
apiVersion: v1
kind: ConfigMap
metadata:
name: world2shift-config
labels:
app: world2shift
data:
index.html: |
<!DOCTYPE html>
<html>
[apply]
whitespace = nowarn
[color]
branch = auto
diff = auto
status = auto
[color "branch"]
current = yellow reverse
local = yellow
remote = green
#!/bin/bash
export OLDPWD=$(pwd)
for i in $(find . -maxdepth 1 -type d | grep -v williamyeh.oracle-java |grep -v ansible-role-bamboo-agent); do
echo $i
cd $i
git_repo=$(git remote -v |head -1 |awk {'print $2'})
cd -
echo "- src: ${git_repo}" >> ../requirements.yml
echo " name: ${i}" >> ../requirements.yml
import requests, json, shutil, sys
base_url = 'confluence'
user = sys.argv[1]
password = sys.argv[2]
path = sys.argv[3]
page_id = sys.argv[4]
r = requests.get( base_url + '/rest/api/content/' + page_id + '/child/attachment', auth=(user, password) )
data = json.loads(r.text)
for i in range(len(data["results"])):
print("Downloading " + data["results"][i]["title"] + "to " + path + data["results"][i]["title"])