View run-logstash.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
docker run -d -p 9300:9300 -v /home/ec2-user/:/var/logstash/ logstash logstash -f /var/logstash/logstash.conf |
View configuration.dev.json
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
{ | |
"Logging": [ | |
{ | |
"key": "minimum-level", | |
"value": "Debug" | |
}, | |
{ | |
"key": "using:RollingFile", | |
"value": "Serilog.Sinks.RollingFile" | |
}, |
View LoggerSettings.cs
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
public class LoggerSettings : ILoggerSettings | |
{ | |
private readonly IConfigurationSection _configuration; | |
public LoggerSettings(IConfigurationSection configuration) | |
{ | |
_configuration = configuration; | |
} | |
public IEnumerable<KeyValuePair<string, string>> Configurations |
View Startup.cs
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
public class Startup | |
{ | |
public Startup(IHostingEnvironment env) | |
{ | |
string configFile = $"config.{env.EnvironmentName}.json".ToLower(); | |
var configBuilder = new ConfigurationBuilder().AddJsonFile(configFile); | |
Configuration = configBuilder.Build(); | |
Log.Logger = new LoggerConfiguration() | |
.ReadFrom.Settings(new LoggerSettings(Configuration.GetSection("Logging"))) |
View alias.bat
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
@ECHO off | |
IF "%1" == "" goto failUsage | |
WHERE alias.cmd > tmpPathFile | |
SET /p currdir= < tmpPathFile | |
del tmpPathFile | |
SET currdir=%currdir:alias.cmd=% |
View ConcurrentFile.cs
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
using System; | |
using System.Diagnostics; | |
using System.IO; | |
using System.Text; | |
namespace Stuffsie | |
{ | |
/// <summary>Wraps concurrent file operations, ensuring access is available to a file before reading or writing</summary> | |
public static class ConcurrentFile | |
{ |
View filebeat-example.yml
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
filebeat: | |
prospectors: | |
- | |
paths: | |
# - C:\Users\David\AppData\Local\Temp\UMS-logs\um-log*.log | |
- /var/log/um-log-*.log | |
encoding: plain | |
input_type: log | |
force_close_files: false |
View EnumerableExtensions.cs
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
public static class EnumerableExtensions | |
{ | |
public static bool TryGetFirst<T>(this IEnumerable<T> source, Func<T, bool> predicate, out T result) | |
{ | |
result = source.FirstOrDefault(predicate); | |
if (default(T) == null) | |
return result != null; | |
return default(T).Equals(result); |
View ExceptionFormatterExtension.cs
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
public static class ExceptionFormatterExtension | |
{ | |
public static string GetDump(this Exception e) | |
{ | |
var exceptions = new Stack<Exception>(); | |
while (e != null) | |
{ | |
exceptions.Push(e); | |
e = e.InnerException; | |
} |
View list-http-status.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
cat pages.txt | xargs -n1 curl -I |
OlderNewer