This file contains hidden or 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
#Download Elementary OS from here: | |
#http://sourceforge.net/projects/elementaryos/files/stable/ | |
#First you update your system | |
sudo apt-get update && sudo apt-get dist-upgrade | |
#Install Google Chrome | |
wget -q -O - https://dl-ssl.google.com/linux/linux_signing_key.pub | sudo apt-key add - | |
sudo sh -c 'echo "deb http://dl.google.com/linux/chrome/deb/ stable main" >> /etc/apt/sources.list.d/google-chrome.list' |
This file contains hidden or 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
using System; | |
using System.Collections.Generic; | |
using System.Diagnostics; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using StackExchange.Redis; | |
namespace RedisPerfTest | |
{ |
This file contains hidden or 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"?> | |
<DiagnosticMonitorConfiguration configurationChangePollInterval="PT5M" overallQuotaInMB="4096" xmlns="http://schemas.microsoft.com/ServiceHosting/2010/10/DiagnosticsConfiguration"> | |
<DiagnosticInfrastructureLogs scheduledTransferPeriod="PT5M" /> | |
<Directories scheduledTransferPeriod="PT1M"> | |
<CrashDumps container="wad-crash-dumps" /> | |
<DataSources> | |
<DirectoryConfiguration container="wad-nlog2" directoryQuotaInMB="512"> | |
<LocalResource relativePath="." name="CustomLogs" /> | |
</DirectoryConfiguration> | |
</DataSources> |
This file contains hidden or 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
public class MessageWorker : RoleEntryPoint | |
{ | |
/* This GIST only demonstrates the OnStart() method. */ | |
public override bool OnStart() | |
{ | |
Trace.WriteLine("Starting MessageWorker Worker Role Instance..."); | |
// Initialize Worker Role Configuration | |
InitializeConfigurationSettings(); |
This file contains hidden or 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
public static class LogTargetManager | |
{ | |
private static Logger logger = LogManager.GetCurrentClassLogger(); | |
public static void SetLogTargetBaseDirectory(string targetName, string baseDirectory) | |
{ | |
logger.Debug("SetLogTargetBaseDirectory() - Log Target Name: {0}.", targetName); | |
logger.Debug("SetLogTargetBaseDirectory() - (New) Base Directory: {0}.", baseDirectory); | |
var logTarget = (FileTarget)LogManager.Configuration.FindTargetByName(targetName); |
This file contains hidden or 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"?> | |
<ServiceDefinition name="MessageWorker" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2014-06.2.4"> | |
<WorkerRole name="MessageWorker.WorkerRole" vmsize="Small"> | |
<Imports> | |
<Import moduleName="Diagnostics" /> | |
<Import moduleName="RemoteAccess" /> | |
<Import moduleName="RemoteForwarder" /> | |
</Imports> | |
<ConfigurationSettings> | |
<Setting name="ServiceBusConnectionString" /> |
This file contains hidden or 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"?> | |
<configuration> | |
<configSections> | |
<section name="nlog" type="NLog.Config.ConfigSectionHandler, NLog" /> | |
</configSections> | |
<nlog xmlns="http://www.nlog-project.org/schemas/NLog.xsd" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"> | |
<targets> | |
<target name="MessageWorker" xsi:type="File" fileName="logs\MessageWorker_Current.log" layout="${longdate} ${level:uppercase=true:padding=5} ${processid} ${message}" archiveFileName="logs\MessageWorker_{#}.txt" archiveEvery="Day" archiveNumbering="Date" archiveDateFormat="yyyy-MM-dd_HH-mm-ss" maxArchiveFiles="14" concurrentWrites="false" keepFileOpen="false" encoding="iso-8859-2" /> | |
</targets> | |
<rules> |
This file contains hidden or 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 cacheItem = CacheSerializer.Deserialize<Guid>(cache.StringGet(cacheKey)); | |
if (cacheItem == Guid.Empty) | |
{ | |
// Cache item doesn't exist, retrieve Guid from source system. | |
// Add (serialized) Guid to the Azure Redis Cache with a lifespan of 90 minutes | |
cache.StringSet(cacheKey, CacheSerializer.Serialize(cacheItem), TimeSpan.FromMinutes(90)); | |
} |
This file contains hidden or 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
/* | |
* A simple generic Serialization Helper allowing custom .Net types to be stored | |
* in the Azure Redis Cache. Inspired by the sample at: | |
* http://msdn.microsoft.com/en-us/library/azure/dn690524.aspx#Objects | |
*/ | |
using System.IO; | |
using System.Runtime.Serialization.Formatters.Binary; | |
namespace AzureRedisCacheSample |