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
var end = new Date(); | |
var start = new Date(); | |
start.setTime(start.getTime()-300000); //5 minutes prior | |
// print dates in the format YYYY-MM-DD HH:MM:SS so we can do Mysql LOAD IN FILE on them | |
// Note that in JS the month portion of the Date constructor is 0-indexed | |
var my_s = start.getFullYear() + "-" + (start.getMonth()+1) + "-" + start.getDate() + " " + start.getHours() + ":" + start.getMinutes() + ":" + start.getSeconds(); | |
var my_e = end.getFullYear() + "-" + (end.getMonth()+1) + "-" + end.getDate() + " " + end.getHours() + ":" + end.getMinutes() + ":" + end.getSeconds(); | |
print(my_s + ',' + my_e); |
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; | |
use warnings; | |
my $file = $ARGV[0]; | |
open FILE, "< $file" or die "Can't open $file : $!"; | |
# save the total impressions across all creatives for this time period for use in reporting (Munin) | |
my $impressions_count_file = "/tmp/impressions-count"; |
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 | |
LOGSDIR="/app/mongodb/logs" | |
# this causes mongo to rotate logs | |
killall -SIGUSR1 mongod | |
# now purge the older logs | |
logs=`find ${LOGSDIR}/ -type f -mtime +30` | |
for log in $logs; do |
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 sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
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
Overview | |
The Global Architecture team at Velti is essentially responsible for overseeing all engineering and operations teams | |
within the Business Units across the company. The team works on few pure coding projects. Instead we're responsible | |
for ensuring the various engineering teams produce reliable, scalable, performant systems that are intended to be | |
reused. You must be comfortable with the "entire stack", being hands off a large part of the time, and driven to stay | |
in touch with the latest technologies. | |
Responsibilities |
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 | |
for pool in `zpool list -H -o name`; do | |
zfs snapshot -r $pool@auto:`date "+%FT%T"` | |
zfs list -H -t snapshot -o name | grep $name@auto: | \ | |
sed -e 's/.*auto://' | sort -r | uniq | tail +14 | \ | |
while read name; do | |
zfs destroy -r $pool@auto:$name | |
done |
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
module Facter::Xvm | |
# | |
# Report if this a an Xvm Dom0 or a DomU. If its a Dom0, also report | |
# a list of any DomU's on the machine (that aren't shut off) | |
# | |
# ASSUMPTIONS: | |
# 1. 'uname -i' reports something unique to identify a Dom0 or a DomU | |
# 2. if the 'virsh' command *also* exists, its a Dom0 | |
# |