fork from http://code.runnable.com/Upjobg9WQ5IHAAB-/how-to-create-custom-filters-in-jinja2-for-python-and-wsgi
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 python3 | |
# -*- coding: utf-8 -*- | |
import os | |
import re | |
import json | |
from io import open | |
from subprocess import Popen, PIPE | |
from tabulate import tabulate |
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 -*- | |
import os | |
import re | |
import argparse | |
from git import Repo | |
from jinja2 import Environment | |
from mailer import Message |
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 | |
import os | |
import argparse | |
def argv_parse(): | |
parser = argparse.ArgumentParser( | |
add_help=True, | |
description='Find big dirrectories', |
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 FullPaths(argparse.Action): | |
"""Expand user- and relative-paths""" | |
def __call__(self, parser, namespace, values, option_string=None): | |
setattr(namespace, self.dest, os.path.abspath(os.path.expanduser(values))) | |
def get_args(): | |
parser = argparse.ArgumentParser(description='Something smart here') | |
parser.add_argument('my_conf', help='The configuration file for the db', action = FullPaths) | |
return parser.parse_args() |
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 | |
######################################################################################## | |
# Compresses old radacct detail files and removes very old compressed radacct files. | |
######################################################################################## | |
# Author: P. Tomulik | |
######################################################################################## | |
# Path to the programs used (for environments without $PATH set) | |
FIND=/usr/bin/find |
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 python | |
# -*- coding: utf-8 -*- | |
import paramiko | |
from paramiko.ssh_exception import SSHException, BadHostKeyException | |
from paramiko.ssh_exception import AuthenticationException | |
from time import sleep |
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 | |
old_path='/home/old_site/public_html' | |
new_path='/home/new_site/public_html' | |
files=" | |
./core/config/config.inc.php | |
./manager/config.core.php | |
./connectors/config.core.php | |
./config.core.php |
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 | |
""" | |
ALK 2014-04-08 | |
aggregate.py: IPv4 & IPv6 replacement (in spirit) for Joe Abley's 'aggregate' command | |
note: not a drop-in replacement for the original 'aggregate' command - command line flags are different | |
requirements: IPy class (debian: python-ipy package) | |
input: list of IPv4 and/or IPv6 addresses and/or subnets (filename or STDIN) | |
output: aggregated list if subnets (STDOUT) |
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 php | |
<?php | |
if (count($argv) == 4) { | |
$token = trim($argv[1]); | |
$subject = trim($argv[2]); | |
$body = trim($argv[3]); | |
$subject = str_replace("PROBLEM:", "\xF0\x9F\x93\x9B PROBLEM:", $subject); | |
$subject = str_replace("OK:", "\xE2\x9C\x85 OK:", $subject); |
NewerOlder