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 | |
from time import sleep | |
import socket | |
log=open("somefile.log","r") | |
log.readlines() | |
pos=log.tell() # This is the last line of the file | |
while True: | |
line=log.readline() |
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
require 'rubygems' | |
require 'sinatra' | |
get '/' do | |
"uploader up" | |
end | |
post '/image' do | |
puts params.inspect | |
File.open("upload-dir/#{params[:id]}", "w") do |f| |
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 | |
echo This script requires super user permissions. Press \'y\' if you are running as super user. | |
read ch | |
count=$1 | |
if [ $ch = "y" ] || [ $ch = "Y" ] | |
then | |
echo in if now | |
while [ $count -ne 0 ] |
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 | |
rsync="rsync -avrt" | |
mirror=mirrors.kernel.org::mirrors/fedora | |
verlist="13 14" | |
archlist="i386" | |
baselist="os" | |
local=/var/www/fedrepo |
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 | |
import boto.ec2.elb | |
import ConfigParser | |
import os.path | |
import sys | |
from optparse import OptionParser | |
check = os.path.isfile(os.path.expanduser('~/.aws.conf')) | |
if cmp(check,False) == 0: |
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 socket | |
import subprocess | |
import random | |
import string | |
BAD_THRESHOLD = 5 # If there are more than these failed attempt then IP will be blocked | |
iptables_str = "/sbin/iptables -I INPUT -s IP-HERE -j DROP\n" | |
identifier = ''.join(random.choice(string.lowercase) for i in range(6)) | |
script = open("/tmp/iptables.sh-" + identifier,"w") |
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
# get this from https://gist.github.com/adimania/96960173f906c9830e22 | |
import json | |
import datetime | |
from flask import Flask, request | |
from flask.ext.sqlalchemy import SQLAlchemy | |
app = Flask(__name__) | |
app.config['SQLALCHEMY_DATABASE_URI'] = 'sqlite:////home/app/inventory.db' | |
db = SQLAlchemy(app) | |
base_uri = '/inv/v1' |
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 subprocess | |
import time | |
import json | |
import re | |
import pynsca | |
import sys | |
from pynsca import NSCANotifier | |
''' | |
We need to alert on 30 Mbps. ifconfig returns bytes. |
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 | |
# You can change the url below if you are going to test a fork. | |
git clone https://github.com/fedora-cloud/Fedora-Dockerfiles.git | |
cd Fedora-Dockerfiles | |
# if you are running against a particular branch then uncomment the line below and write the branch name. | |
# git checkout <branch_name> | |
mkdir logs | |
dfiles_dir=$(pwd) |
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
apiVersion: v1 | |
kind: ReplicationController | |
metadata: | |
name: nginx-flask-controller | |
spec: | |
replicas: 2 | |
selector: | |
app: nginx-flask-pod | |
template: | |
metadata: |
OlderNewer