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
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|AnyCPU'"> | |
<PlatformTarget>AnyCPU</PlatformTarget> | |
<DebugSymbols>true</DebugSymbols> | |
<DebugType>full</DebugType> | |
<Optimize>false</Optimize> | |
<OutputPath>bin\Debug\</OutputPath> | |
<DefineConstants>DEBUG;TRACE</DefineConstants> | |
<ErrorReport>prompt</ErrorReport> | |
<WarningLevel>4</WarningLevel> | |
<OutputType>Exe</OutputType> |
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
if (Get-Service "MyCustomService" -ErrorAction SilentlyContinue) { | |
sc.exe delete MyCustomService | Write-Host | |
} |
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
sc.exe config MyCustomService obj= user@company.com password= "password" |
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
sc.exe config MyCustomService depend= LanmanWorkstation |
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
internal static byte[] EncodeToBytes(this IDataStructure data) | |
{ | |
// get the unmanaged size of the data in bytes being marshalled. | |
var size = Marshal.SizeOf(data); | |
// allocate unmanaged memory of size bytes. | |
var ptr = Marshal.AllocHGlobal(size); | |
// marshall the data from managed to unmanaged memory. | |
// passing true as the last parameter allows all unmanaged |
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
db.people.find().forEach( function(x){db.user.insert(x)} ); |
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
<# | |
This script will start any non-disabled SystemX service on the machine on which it is run. | |
This script, as written, executes as part of an OctopusDeploy project. | |
#> | |
# Receive OctopusDeploy parameter that indicates the SystemX Service name prefix value. | |
# Capture supplied OctopusDeploy variable in a local variable. | |
$prefixValue = $OctopusParameters['SystemXServiceNamePrefix'] | |
Write-Output "SystemX Service prefix value is: $prefixValue" |
OlderNewer