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 | |
URL=$1 | |
COUNT=$2 | |
if [ -z "${COUNT}" ]; then | |
COUNT=10 | |
fi | |
echo "Downloading ${URL}:" |
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
FNAME=$1 | |
COUNT=$2 | |
i=1 | |
while [[ $i -le $COUNT ]] | |
do | |
echo "$i..." | |
openssl rand -out out-${FNAME}.${i}.bin -base64 $(( 2**30 * 3/4 )) | |
((i = i + 1)) | |
done |
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
import logging | |
from time import sleep | |
from multiprocessing import Process | |
from django.core.management.base import BaseCommand, CommandError | |
logger = logging.getLogger(__name__) | |
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
from elasticsearch import Elasticsearch, TransportError | |
from nose.plugins import Plugin | |
import os | |
import shutil | |
import subprocess | |
import tempfile | |
import socket | |
from time import sleep | |
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
import sched, time | |
class looper(sched.scheduler): | |
def loop(self, interval, p, action, actionargs=()): | |
self.enter(interval, 1, self.loop, (interval, p, action, actionargs)) | |
action(*actionargs) | |
s = looper(time.time, time.sleep) |
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
from itertools import cycle | |
import sys | |
import argparse | |
import random | |
from PIL import ImageFont | |
from PIL import Image | |
from PIL import ImageDraw | |
import datetime |
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
INFO 2015-06-12 09:39:01,562 77120 139952186169088 samples.collector Collector 0969b32ef602cfffb1a6b48f433abaf182f855e1 starting | |
ERROR 2015-06-12 09:39:01,587 77120 139952186169088 samples.management.commands.collector_agent Message processing failed | |
Traceback (most recent call last): | |
File "/opt/tcbase/tcbase/samples/management/commands/collector_agent.py", line 77, in handle_message | |
result = obj.process(data) | |
File "/usr/lib/python2.6/site-packages/django/db/transaction.py", line 371, in inner | |
return func(*args, **kwargs) | |
File "/opt/tcbase/tcbase/samples/collector.py", line 133, in process | |
self.process_samples(data, tool, source, root_sample) | |
File "/opt/tcbase/tcbase/networkevents/collector.py", line 125, in process_samples |
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
class A(object): | |
def method(self): | |
print "I'm method in A" | |
def __method__(self): | |
print "I'm __method__ in A" | |
def __method(self): | |
print "I'm __method in A" |
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
# Install build tools | |
sudo yum -y install epel-release | |
sudo yum -y install rpm-devel rpm-build rpmdevtools python-setuptools python-devel | |
sudo yum -y install mock | |
sudo yum -y install fedora-packager | |
# Install build dependencies | |
sudo yum install automake libtool emacs emacs-el java-devel jpackage-utils maven-local maven-compiler-plugin maven-install-plugin maven-jar-plugin maven-javadoc-plugin maven-resources-plugin maven-surefire-plugin maven-antrun-plugin | |
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 | |
# -*- coding: utf-8 -*- | |
DOCUMENTATION = ''' | |
version_added: "1.0" | |
module: custom | |
short_description: Custom ansible module | |
description: | |
- Custom ansible module | |
- Put into ./library/ dir |