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
ObjectId = require("mongoose").Types.ObjectId | |
new ObjectId('xxxx') |
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 | |
# modified by jfro from http://www.cnysupport.com/index.php/linode-dynamic-dns-ddns-update-script | |
# Uses curl to be compatible with machines that don't have wget by default | |
# modified by Ross Hosman for use with cloudflare. | |
cfkey= | |
cfuser= | |
cfhost= | |
WAN_IP=`curl -s http://ip.skafari.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
<?xml version="1.0" encoding="UTF-8"?> | |
<CORSConfiguration xmlns="http://s3.amazonaws.com/doc/2006-03-01/"> | |
<CORSRule> | |
<AllowedOrigin>*</AllowedOrigin> | |
<AllowedMethod>GET</AllowedMethod> | |
<AllowedMethod>POST</AllowedMethod> | |
<AllowedMethod>PUT</AllowedMethod> | |
<MaxAgeSeconds>3000</MaxAgeSeconds> | |
<AllowedHeader>*</AllowedHeader> | |
</CORSRule> |
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
def web_cluster(): | |
env.user = 'ubuntu' | |
env.key_filename = ['mykey.pem'] | |
env.conftype = 'prod' | |
env.project = 'sample' | |
ec2conn = ec2.connection.EC2Connection(AWS_ACCESS_KEY_ID, AWS_SECRET_ACCESS_KEY) | |
web_group = ec2conn.get_all_security_groups(groupnames=['web']) | |
for i in web_group[0].instances(): | |
hostname = i.__dict__['public_dns_name'] |
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 os | |
import sys | |
import time | |
import random | |
import string | |
import json | |
import hashlib | |
import socket |
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 | |
print 'hello' |
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
use File::Tail; | |
my @errors = (’Bad protocol version identification’,'Failed password’,'Did not receive identification string’); | |
my $line; | |
my $file = File::Tail->new(”/var/log/auth.log”); | |
while (defined($line=$file->read)) { | |
if ($line =~ /$errors[0]|$errors[1]|$errors[2]/) { | |
open(SSHALERT, “>/tmp/sshalert.txt”); | |
print SSHALERT “$line”; |
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/perl | |
use strict; | |
open(DID, ">>/path/to/iDid.txt"); | |
my $time = &gettime(); | |
sub gettime { | |
my @timearray = (my $_sec,my $_min,my $_hour,my $_mday,my $_mon,my $_year,my $_wday,my $_yday,my $_isdst) = localtime(time); | |
my $months = ('Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec')[(localtime)[4]]; |
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 | |
logger System VM Weekly Snapshot Begin | |
vmrun snapshot /dir/to/vm/images/image_name.vmx weekly_auto_backup | |
vmrun snapshot /dir/to/vm/images/image_name.vmx weekly_auto_backup | |
mount /dev/name /mnt/location | |
rsync -avg --ignore-errors /dir/to/vm/images/ /mnt/location/VM-BACKUP/ | |
umount /dev/name | |
logger System VM Weekly Snapshot Complete |
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
use strict; | |
use File::Tail; | |
use Net::Syslog; | |
my $s=new Net::Syslog(Facility=>’local7′,Priority=>’System’,SyslogPort=>’514′,SyslogHost=>’10.0.0.5′); | |
my $log=File::Tail->new(’c:windowssystem32logfilesw3svc1www.log’); | |
while (defined(my $line=$log->read)) { | |
$s->send($line,Priority=>’system’); | |
} |