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 |
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" | |
}, |
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 |
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"))) |
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=% |
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 |
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); |
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; | |
} |
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 |
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.Collections.Generic; | |
using System.Linq; | |
namespace System.Collections.Generic | |
{ | |
public static class SampleCollectionExtension | |
{ | |
private static readonly Random Random = new Random(); |
OlderNewer