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
# /etc/lvm/lvm.conf | |
. . . | |
filter = [ "r|/dev/dm-*|", "r|/dev/vg*|", "r|/dev/mapper/*|", "a/.*/" ] | |
. . . |
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 | |
# | |
# Copyright (C) Matthieu Patou <mat at matws.net> 2011-2012 | |
# | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation; either version 3 of the License, or | |
# (at your option) any later version. | |
# | |
# This program is distributed in the hope that it will be useful, |
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 | |
INSTALAR="N"; | |
AUTOR="[email protected]"; | |
TMP_DIR="/tmp/upgZabbix"; | |
DATA_BACKUP=`date +%Y%m%d`; | |
idioma() { | |
# Selecao de Idioma ------------------------------------------------------------------------- | |
if [ -d $TMP_DIR ]; then |
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 | |
# Called by cron: 0 0 * * * /root/scripts/cron-weekly.sh "/myscript.sh" | |
# "/myscript.sh" should handle "monthly", "weekly" and "daily" parameters. | |
wkdate=`date +%w` | |
DD=`date +%d` | |
# Mon - Fri, & Sun run daily | |
# Saturday run weekly except: |
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
. . . | |
perl -ni -e 'print unless $. == 1' filename.txt | |
. . . |
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 re | |
str = '{12948}>{$CPU_LOAD_MAX}' | |
m = re.search('(?:{)(?P<num>\d+)(?:})', str) | |
print(m.group('num') |
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
grep fping /var/log/audit/audit.log | audit2allow -M zabbix_fping | |
semodule -i zabbix_fping.pp |
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
# http://technet.microsoft.com/en-us/library/ee198834.aspx | |
(&(objectCategory=person)(memberOf:1.2.840.113556.1.4.1941:=(CN=TargetGroup,CN=Users,DC=DOMAIN,DC=COM))) |
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 python2 | |
# -*- coding: utf-8 -*- | |
# | |
# Based on: | |
# https://gist.github.com/martin-ueding/4007035#file-colorcodes-py | |
# https://gist.github.com/jyros/5169803#file-colorcodes-py | |
# https://gist.github.com/housemaister/5255959#file-colorcodes-py | |
# | |
# Copyright (c) 2012 Martin Ueding <[email protected]> | |
# Copyright (c) 2013 Jairo Sanchez <[email protected]> |
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 | |
import sys | |
fname = "./lockfile" | |
if os.path.isfile(fname): | |
os.remove(fname) | |
try: | |
a = os.open(fname, os.O_WRONLY | os.O_CREAT | os.O_EXCL, 0644) | |
os.write(a, str(os.getpid()) + '\n') |