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 Program | |
{ | |
static int bats = 0; | |
static int frogs = 0; | |
static void Main(string[] args) | |
{ | |
using (var store = new EmbeddableDocumentStore()) | |
{ | |
store.Initialize(); |
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
# | |
# Assumptions | |
# | |
# 1. If you have a Octopus release deployed, say 1.0.0.73, there is a git | |
# tag set for that commit in GitHub that is "v1.0.0.73". | |
# | |
# 2. You have TeamCity label each successful build in GitHub with the format | |
# "v{build number}. Sidenote: it appears that TeamCity only labels the | |
# default branch, but not feature branches. | |
# |
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 | |
# To be used as a cron job weekly (or other) placed under /etc/cron.weekly | |
# Will use mongodb's logrotate function, but then will compress and keep at most 12 weeks worth of rotate logs. | |
killall -SIGUSR1 `cat /var/run/mongodb/mongod.pid` | |
gzip /var/log/mongodb/*20[0-9][0-9]-*-[0-9][0-9] | |
logs_total=`ls -tx1 /var/log/mongodb/ | egrep "20[0-9][0-9]-.*\.gz" | wc -l` | |
if [ "$logs_total" -gt 12 ]; then | |
logs_difference=`expr $logs_total - 12` | |
logs_to_remove=`ls -tx1 /var/log/mongodb/ | egrep "20[0-9][0-9]-.*\.gz" | tail -n $logs_difference` | |
for log_file in $logs_to_remove; 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
Import-Module Seq | |
# Specify the Seq server URL; an -apiKey can also be provided. | |
# Any properties set here will be attached to all events. | |
$seq = Open-Seq "http://my-seq" -properties @{ Machine = $env:ComputerName } | |
# Simple information method | |
Send-SeqEvent $seq "Hello from PowerShell" |