Skip to content

Instantly share code, notes, and snippets.

import logging
import sushy
import json
SUSHY_PROTO = 'http'
SUSHY_HOST = 'localhost'
SUSHY_PORT = 8000
SUSHY_BASE = '/redfish/v1'
SUSHY_USER = ""
SUSHY_PASSWORD = ""
#!/usr/bin/env python3
import argparse
import etcd3gw
import platform
import shutil
import subprocess
import urllib.parse
@mwhahaha
mwhahaha / dstat.csv
Last active June 11, 2020 22:21
ansible-70023
We can make this file beautiful and searchable if this error is corrected: It looks like row 2 should actually have 1 column, instead of 7. in line 1.
"pcp-dstat 4.3.2 CSV Output"
"Author:","PCP team <pcp@groups.io> and Dag Wieers <dag@wieers.com>",,,,"URL:","https://pcp.io/ and http://dag.wieers.com/home-made/dstat/"
"Host:","centos-8-vexxhost-ca-ymq-1-0017074251",,,,"User:","root"
"Cmdline:","dstat -tcmndrylpg --nocolor --output /var/log/extra/dstat-csv.log 1",,,,"Date:","10 Jun 2020 20:57:01 UTC"
"system","total usage",,,,,,,,,"memory usage",,,,"net/total",,,"dsk/total",,,"io/total",,"system",,"load avg",,,"procs",,,"paging"
"time","total usage:usr","total usage:sys","total usage:idl","total usage:wai","total usage:stl","used","free","buf","cach","net/total:recv","net/total:send","dsk/total:read","dsk/total:writ","read","writ","int","csw","1m","5m","15m","run","blk","new","in","out"
10-06 20:57:01,,386952,4200372,314092,2851676,,,,,,,1.080,1.060,0.680,1,0,,,
10-06 20:57:02,8.612,4.369,84.625,1.747,0,408840,4177896,314104,2851964,163621.350,125919.262,0,5659.607,0,433.357,5899,3342,1.080,1.060,0.680,0,0,30.954,0,0
10-06 20:57:03,6.625,5.875,86.628,0.250,0
@mwhahaha
mwhahaha / centos7.mirror.sh
Last active April 5, 2020 00:39
rdo mirroring
#!/bin/bash
#rsync -avSHP --delete --exclude "local*" --exclude "isos" --exclude "atomic" rsync://mirrors.serenitytek.com/centos/7/ /home/aschultz/mirror/CentOS/7/
MIRROR_LIST=(rsync://mirrors.syringanetworks.net/centos/7/ rsync://mirrors.serenitytek.com/centos/7/ rsync://bay.uchicago.edu/CentOS/7/ rsync://mirror.oss.ou.edu/centos/7/ rsync://mirrors.xmission.com/centos/7/ rsync://mirror.chpc.utah.edu/pub/centos/7/)
MIRROR_DIR=/var/lib/www/mirror/repos/centos/7/
MIRROR_EXCLUDES="local* atomic configmanagement cr dotnet fasttrack isos nfv rt sclo"
mkdir -p $MIRROR_DIR
✗ ansible-playbook sigh.yml -vvv
ansible-playbook 2.10.0.dev0
config file = None
configured module search path = ['/home/aschultz/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
ansible python module location = /home/aschultz/.virtualenvs/ansible-devel/lib/python3.6/site-packages/ansible-2.10.0.dev0-py3.6.egg/ansible
executable location = /home/aschultz/.virtualenvs/ansible-devel/bin/ansible-playbook
python version = 3.6.8 (default, Oct 8 2019, 16:29:04) [GCC 8.2.1 20180905 (Red Hat 8.2.1-3)]
No config file found; using defaults
host_list declined parsing /etc/ansible/hosts as it did not pass its verify_file() method
Skipping due to inventory source not existing or not being readable by the current user
@mwhahaha
mwhahaha / move_bugs.py
Created September 26, 2019 16:57
tripleo-move-bugs
#!/usr/bin/env python
from __future__ import print_function
# Example usage:
# python move_bugs.py --no-dry-run --priority-less-than High tripleo stein-3 train-1
# python move_bugs.py --no-dry-run tripleo stein-3 stein-rc1
# python move_bugs.py --no-dry-run --priority-less-than High tripleo stein-rc1 train-1
# python move_bugs.py --no-dry-run --priority-less-than Critical tripleo stein-rc1 train-1
# python move_bugs.py --no-dry-run tripleo stein-rc1 train-1
import argparse
- name: Async pull images from remote mirror and push into local registry
docker_image:
name: "{{ async_item.imagename }}"
repository: "localhost:8787/{{ async_item.imagename | regex_replace('docker.io/') }}"
push: yes
debug: yes
async: 1500
poll: 0
loop: "{{ images }}"
loop_control:
@mwhahaha
mwhahaha / loop.yml
Created August 15, 2018 23:15
ansible array appending with set_fact
---
- name: looping
shell: >
echo "{{ loop_input }}"
register: foo
- set_fact:
loop_var: []
when: loop_var is not defined
#!/usr/bin/env python
from __future__ import print_function
import argparse
import lazr.restfulclient.errors
import os
import sys
# import sqlite3
from launchpadlib import launchpad
# install puppetlabs puppet
wget http://apt.puppetlabs.com/puppetlabs-release-pc1-xenial.deb
dpkg -i puppetlabs-release-pc1-xenial.deb
apt-get install puppet-agent
# disable verification for ceph packages
echo 'APT::Get::AllowUnauthenticated "true";' >> /etc/apt/apt.conf.d/99disableverification
# get p-o-i
git clone https://github.com/openstack/puppet-openstack-integration
cd puppet-openstack-integration