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
docker images -q --filter "dangling=true" | xargs docker rmi |
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
touch -h -d '-100 day' --time=mtime /etc/mock/* |
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 RedisLogHandler(Process): | |
""" | |
Single point to collect logs through redis pub/sub and write | |
them through standard python logging lib | |
""" | |
def __init__(self, opts): | |
Process.__init__(self, name="log_handler") |
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
PGPASSWORD=coprpass psql -a -h localhost -U copr-fe coprdb -c "\copy (select api_login, api_token from public.user where username='kost2') to '/tmp/credentionals.csv' with csv " |
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
from __future__ import print_function | |
from __future__ import unicode_literals | |
from __future__ import division | |
from __future__ import absolute_import | |
import os | |
from pwd import getpwnam | |
from grp import getgrnam | |
import logging | |
from subprocess import Popen, PIPE |
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
from celery.contrib import rdb; rdb.set_trace() |
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
@pytest.yield_fixture | |
def mc_logging(): | |
with mock.patch("backend.daemons.log.logging") as mc_logging: | |
yield mc_logging | |
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/python | |
import os | |
from time import sleep | |
import plumbum as pb | |
import plumbum.cli as cli | |
from plumbum.cmd import inotifywait | |
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/sh | |
for package in $@ | |
do | |
echo "removing config files for $package" | |
for file in $(rpm -q --configfiles $package) | |
do | |
echo " removing $file" | |
rm -f $file | |
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
import os | |
class Writer(object): | |
def __init__(self, base_dir): | |
self.base_dir = base_dir | |
self.pool = {} | |
def _get_fh(self, name): | |
if name not in self.pool: | |
self.pool[name] = open(os.path.join(self.base_dir, name), "w") |