This file contains hidden or 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 | |
"""Script to create reoccuring maintenance windows for PagerDuty""" | |
# | |
# Copyright (c) 2016, PagerDuty, Inc. <[email protected]> | |
# Copyright (c) 2022, BrainMill AB, <[email protected]> | |
# All rights reserved. | |
# | |
# Redistribution and use in source and binary forms, with or without | |
# modification, are permitted provided that the following conditions are met: | |
# * Redistributions of source code must retain the above copyright |
This file contains hidden or 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
## Stop all OSDs | |
## Set OSD nodown | |
ceph osd set nodown | |
##Set OSD nobackfill | |
ceph osd set nobackfill | |
This file contains hidden or 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
ceilometer=# SELECT | |
ceilometer-# sample.meter_id AS sample_meter_id, | |
ceilometer-# meter.name AS meter_name, | |
ceilometer-# meter.type AS meter_type, | |
ceilometer-# meter.unit AS meter_unit, | |
ceilometer-# resource.resource_id AS resource_resource_id, | |
ceilometer-# resource.project_id AS resource_project_id, | |
ceilometer-# resource.source_id AS resource_source_id, | |
ceilometer-# resource.user_id AS resource_user_id | |
ceilometer-# FROM sample |
This file contains hidden or 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
-- A ceilometer (newton) resource query can look like the following: | |
--SQL: 'SELECT sample.meter_id AS sample_meter_id, meter.name AS meter_name, meter.type AS meter_type, meter.unit AS meter_unit, resource.resource_id AS resource_resource_id, resource.project_id AS resource_project_id, resource.source_id -- AS resource_source_id, resource.user_id AS resource_user_id | |
-- FROM sample JOIN (SELECT max(sample.id) AS id | |
-- FROM sample JOIN resource ON resource.internal_id = sample.resource_id | |
-- WHERE resource.resource_id = %(resource_id_1)s GROUP BY sample.meter_id, resource.resource_id) AS anon_1 ON anon_1.id = sample.id JOIN meter ON meter.id = sample.meter_id JOIN resource ON resource.internal_id = sample.resource_id | |
-- WHERE resource.resource_id = %(resource_id_2)s'] | |
-- [parameters: {'resource_id_1': u'02c92f6c-6596-489e-a710-0321f3501256', 'resource_id_2': u'02c92f6c-6596-489e-a710-0321f3501256'} | |
-- In the ceilometer database in question, the sample table has 141M rows and the resource table has 1.2M r |
This file contains hidden or 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
def put_object(ioctx, diskpath, objprefix): | |
""" Puts an object from disk, using (objprefix + filename) as key. | |
Naive code which reads entire object to memory before writing. | |
""" | |
bufsize = 2**20 ## 1 MiB | |
key = objprefix + os.path.basename(diskpath) | |
offset = 0 | |
sha = hashlib.sha512() | |
fhd = open(diskpath, 'rb') |
This file contains hidden or 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
endpoint = 'https://nova.api.cloud.ipnett.se/v2/<some_tenant_uuid>' | |
parts = parse.urlparse(endpoint) | |
if ':' in parts.netloc: | |
root_endpoint = "://".join([parts.scheme, parts.netloc]) | |
else: | |
root_endpoint = endpoint | |
print root_endpoint | |
# Example |
This file contains hidden or 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/python | |
""" Glance client to convert QCOW2 images in Glance to RAW """ | |
# from pprint import pprint | |
from os import environ as env | |
import collections | |
import subprocess | |
# import sys | |
from glanceclient.v2 import client as glclient |
This file contains hidden or 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
[root@ceph-prod-radosgw1 ~]# rados -p .rgw.root bench 30 write | |
Maintaining 16 concurrent writes of 4194304 bytes for up to 30 seconds | |
Object prefix: benchmark_data_ceph-prod-radosgw1.srv.cloud._23901 | |
sec Cur ops started finished avg MB/s cur MB/s last lat avg lat | |
0 0 0 0 0 0 - 0 | |
1 16 16 0 0 0 - 0 | |
2 16 16 0 0 0 - 0 | |
3 16 16 0 0 0 - 0 | |
4 16 16 0 0 0 - 0 | |
5 16 16 0 0 0 - 0 |
This file contains hidden or 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
Hej! | |
Priset för att bo i bostadsrätt jämställs med hyrornas utveckling i hyresrätter. (hyresekvivalensansatsen) | |
Däremot beräknas kapitalkostnaden för egnahem dels baserat på räntenivån (räntestasindex), | |
dels på ett ca 40 årigt glidande medelvärde av fastighetsprisernas utveckling (kapitalstocksindex). | |
Produkten av dessa två komponenter utgör räntekostnadsindex för egnahem i KPI. | |
Bostadsrättspriser påverkar således inte KPI. |
This file contains hidden or 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 | |
infile=$1 | |
echo "date,members" > out.data | |
sed -e 's/^nmembers[ \t]*\([0-9\-]*\)[ \t]*\(.*\)$/\1,\2/g' $infile >> out.data |
NewerOlder